Skip to content

Commit

Permalink
Deprecate should and should_not
Browse files Browse the repository at this point in the history
  • Loading branch information
twe4ked committed Mar 21, 2014
1 parent 12f7694 commit 61f5950
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rspec/its.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ def is_expected
end

def should(matcher=nil, message=nil)
RSpec.deprecate("Using `its(:foo) { should eq 'foo' }`", :replacement => "`its(:foo) { is_expected.to eq 'foo' }`")
RSpec::Expectations::PositiveExpectationHandler.handle_matcher(__its_subject, matcher, message)
end

def should_not(matcher=nil, message=nil)
RSpec.deprecate("Using `its(:foo) { should_not eq 'foo' }`", :replacement => "`its(:foo) { is_expected.to not eq 'foo' }`")
RSpec::Expectations::NegativeExpectationHandler.handle_matcher(__its_subject, matcher, message)
end

Expand Down

0 comments on commit 61f5950

Please sign in to comment.