diff options
author | Vitali Tatarintev <vtatarintev@gitlab.com> | 2019-08-28 09:55:46 +0300 |
---|---|---|
committer | Vitali Tatarintev <vtatarintev@gitlab.com> | 2019-08-28 09:55:46 +0300 |
commit | 24493c50232b6109bbcc680ada32dfe832201a67 (patch) | |
tree | ad34f436afc5cf661d06742e226df49058743eac /spec/rubocop/cop/rspec | |
parent | 69dbc5a5270a2b00bc2e359af37d6176748db400 (diff) |
Replace it_behaves_like with include_examples
Improve specs output readability by replacing
`it_behaves_like` with `include_examples`
in `BeSuccessMatcher`
Diffstat (limited to 'spec/rubocop/cop/rspec')
-rw-r--r-- | spec/rubocop/cop/rspec/be_success_matcher_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/rubocop/cop/rspec/be_success_matcher_spec.rb b/spec/rubocop/cop/rspec/be_success_matcher_spec.rb index 17408a696de..12aa7d1643e 100644 --- a/spec/rubocop/cop/rspec/be_success_matcher_spec.rb +++ b/spec/rubocop/cop/rspec/be_success_matcher_spec.rb @@ -13,7 +13,7 @@ describe RuboCop::Cop::RSpec::BeSuccessMatcher do shared_examples 'cop' do |good:, bad:| context "using #{bad} call" do - it "registers an offense for `#{bad}`" do + it 'registers an offense' do inspect_source(bad, source_file) expect(cop.offenses.size).to eq(1) @@ -21,7 +21,7 @@ describe RuboCop::Cop::RSpec::BeSuccessMatcher do expect(cop.highlights).to eq([bad]) end - it "registers an offense for `#{bad}` and autocorrects it to `#{good}`" do + it "autocorrects it to `#{good}`" do autocorrected = autocorrect_source(bad, source_file) expect(autocorrected).to eql(good) @@ -37,27 +37,27 @@ describe RuboCop::Cop::RSpec::BeSuccessMatcher do end end - it_behaves_like 'cop', + include_examples 'cop', bad: 'expect(response).to be_success', good: 'expect(response).to be_successful' - it_behaves_like 'cop', + include_examples 'cop', bad: 'expect(response).to_not be_success', good: 'expect(response).to_not be_successful' - it_behaves_like 'cop', + include_examples 'cop', bad: 'expect(response).not_to be_success', good: 'expect(response).not_to be_successful' - it_behaves_like 'cop', + include_examples 'cop', bad: 'is_expected.to be_success', good: 'is_expected.to be_successful' - it_behaves_like 'cop', + include_examples 'cop', bad: 'is_expected.to_not be_success', good: 'is_expected.to_not be_successful' - it_behaves_like 'cop', + include_examples 'cop', bad: 'is_expected.not_to be_success', good: 'is_expected.not_to be_successful' end |