コメントアウトすると、RSpecの実行結果からコメントアウトしていることに気づけない
pasta_spec.rb
describe Pasta, type: :model do
describe '#boil' do
context '14mm' do
# it { expect(Pasta.new(size: 14).boil(min: 8)).to eq TASTE::NICE }
end
context '18mm' do
# it { expect(Pasta.new(size: 18).boil(min: 8)).to eq TASTE::SOLID }
end
end
# ..略(このあと、47個のテストがある)..
end
RSpec
$docker-compose exec web bundle exec rspec spec/models/pasta_spec.rb
...............................................
Finished in 1.55 seconds (files took 3.7 seconds to load)
47 examples, 0 failures
itにxをつけて、xitとすると、実行結果に明示的にpendingと出る
pasta_spec.rb
describe Pasta, type: :model do
describe '#boil' do
context '14mm' do
xit { expect(Pasta.new(size: 14).boil(min: 8)).to eq TASTE::NICE }
end
context '18mm' do
xit { expect(Pasta.new(size: 18).boil(min: 8)).to eq TASTE::SOLID }
end
end
# ..略(このあと、47個のテストがある)..
end
RSpec
$docker-compose exec web bundle exec rspec spec/models/pasta_spec.rb
..**.............................................
Pending: (Failures listed here are expected and do not affect your suite's status)
1) Pasta #boil 14mm 8 min should eq nice
# Temporarily skipped with xit
# ./spec/models/pasta_spec.rb:19
2) Pasta #boil 18mm 8 min should eq かたい
# Temporarily skipped with xit
# ./spec/models/pasta_spec.rb:24
49 examples, 0 failures, 2 pending