Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitali Tatarintev <vtatarintev@gitlab.com>2019-08-23 12:05:50 +0300
committerVitali Tatarintev <vtatarintev@gitlab.com>2019-08-28 09:43:47 +0300
commitb61d26f496a2041d7124fd3280031deda3cf5a43 (patch)
treed8a8ffdc6e40b68aa814d41536bb304250ee8037 /rubocop/cop/rspec
parent23da356dd1a048ca86c95960fb0b76df914f9087 (diff)
Add support of not_to/to_not to BeSuccessMatcher
BeSuccessMatcher now supports following examples: ``` expect(response).to be_success expect(response).to_not be_success expect(response).not_to be_success is_expected.to be_success is_expected.to_not be_success is_expected.not_to be_success ```
Diffstat (limited to 'rubocop/cop/rspec')
-rw-r--r--rubocop/cop/rspec/be_success_matcher.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/rubocop/cop/rspec/be_success_matcher.rb b/rubocop/cop/rspec/be_success_matcher.rb
index 18bcfa6d582..ca937a8ee9f 100644
--- a/rubocop/cop/rspec/be_success_matcher.rb
+++ b/rubocop/cop/rspec/be_success_matcher.rb
@@ -29,11 +29,11 @@ module RuboCop
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))
+ (send (send nil? :expect (send nil? ...)) {:to :not_to :to_not} (send nil? :be_success))
PATTERN
def_node_search :is_expected_to_be_success?, <<~PATTERN
- (send (send nil? :is_expected) :to (send nil? :be_success))
+ (send (send nil? :is_expected) {:to :not_to :to_not} (send nil? :be_success))
PATTERN
def be_success_usage?(node)