summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rubocop/cop/rspec/be_success_matcher.rb4
-rw-r--r--spec/rubocop/cop/rspec/be_success_matcher_spec.rb18
2 files changed, 11 insertions, 11 deletions
diff --git a/rubocop/cop/rspec/be_success_matcher.rb b/rubocop/cop/rspec/be_success_matcher.rb
index 9ab344a3762..18bcfa6d582 100644
--- a/rubocop/cop/rspec/be_success_matcher.rb
+++ b/rubocop/cop/rspec/be_success_matcher.rb
@@ -26,7 +26,7 @@ module RuboCop
class BeSuccessMatcher < RuboCop::Cop::Cop
include SpecHelpers
- MESSAGE = "Don't use deprecated `success?` method, use `successful?` instead.".freeze
+ MESSAGE = 'Do not use deprecated `success?` method, use `successful?` instead.'.freeze
def_node_search :expect_to_be_success?, <<~PATTERN
(send (send nil? :expect (send nil? ...)) :to (send nil? :be_success))
@@ -49,7 +49,7 @@ module RuboCop
def autocorrect(node)
lambda do |corrector|
- corrector.insert_after(node.loc.expression, "ful")
+ corrector.insert_after(node.loc.expression, 'ful')
end
end
end
diff --git a/spec/rubocop/cop/rspec/be_success_matcher_spec.rb b/spec/rubocop/cop/rspec/be_success_matcher_spec.rb
index 26044b1ef24..b55e63ec7f0 100644
--- a/spec/rubocop/cop/rspec/be_success_matcher_spec.rb
+++ b/spec/rubocop/cop/rspec/be_success_matcher_spec.rb
@@ -42,17 +42,17 @@ describe RuboCop::Cop::RSpec::BeSuccessMatcher do
allow(cop).to receive(:in_controller_spec?).and_return(true)
end
- context "using expect(response).to be_success call" do
+ context 'using expect(response).to be_success call' do
it_behaves_like 'an offensive be_success call', OFFENSE_CALL_EXPECT_TO_BE_SUCCESS
it_behaves_like 'an autocorrected be_success call', OFFENSE_CALL_EXPECT_TO_BE_SUCCESS, CALL_EXPECT_TO_BE_SUCCESSFUL
end
- context "using is_expected.to be_success call" do
+ context 'using is_expected.to be_success call' do
it_behaves_like 'an offensive be_success call', OFFENSE_CALL_IS_EXPECTED_TO_BE_SUCCESS
it_behaves_like 'an autocorrected be_success call', OFFENSE_CALL_IS_EXPECTED_TO_BE_SUCCESS, CALL_IS_EXPECTED_TO_BE_SUCCESSFUL
end
- context "using expect(response).to be_successful" do
+ context 'using expect(response).to be_successful' do
it "does not register an offense" do
inspect_source(CALL_EXPECT_TO_BE_SUCCESSFUL)
@@ -60,8 +60,8 @@ describe RuboCop::Cop::RSpec::BeSuccessMatcher do
end
end
- context "using is_expected.to be_successful" do
- it "does not register an offense" do
+ context 'using is_expected.to be_successful' do
+ it 'does not register an offense' do
inspect_source(CALL_IS_EXPECTED_TO_BE_SUCCESSFUL)
expect(cop.offenses.size).to eq(0)
@@ -70,16 +70,16 @@ describe RuboCop::Cop::RSpec::BeSuccessMatcher do
end
context 'outside of a controller spec file' do
- context "using expect(response).to be_success call" do
- it "does not register an offense" do
+ context 'using expect(response).to be_success call' do
+ it 'does not register an offense' do
inspect_source(OFFENSE_CALL_EXPECT_TO_BE_SUCCESS)
expect(cop.offenses.size).to eq(0)
end
end
- context "using is_expected.to be_success call" do
- it "does not register an offense" do
+ context 'using is_expected.to be_success call' do
+ it 'does not register an offense' do
inspect_source(OFFENSE_CALL_IS_EXPECTED_TO_BE_SUCCESS)
expect(cop.offenses.size).to eq(0)