Skip to content

Commit 82868a2

Browse files
committed
Deprecate old-style matchers to avoid adding new specs using them
* See ruby/spec#1350 and #80
1 parent 8af2561 commit 82868a2

28 files changed

Lines changed: 31 additions & 9 deletions

lib/mspec/matchers/base.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'mspec/utils/deprecate'
2+
13
module MSpecMatchers
24
end
35

lib/mspec/matchers/be_an_instance_of.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def negative_failure_message
2121

2222
module MSpecMatchers
2323
private def be_an_instance_of(expected)
24+
MSpec.deprecate __method__, '.should.instance_of?'
2425
BeAnInstanceOfMatcher.new(expected)
2526
end
2627
end

lib/mspec/matchers/be_ancestor_of.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def negative_failure_message
1919

2020
module MSpecMatchers
2121
private def be_ancestor_of(expected)
22+
MSpec.deprecate __method__, '.ancestors.should.include?'
2223
BeAncestorOfMatcher.new(expected)
2324
end
2425
end

lib/mspec/matchers/be_empty.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def negative_failure_message
1515

1616
module MSpecMatchers
1717
private def be_empty
18+
MSpec.deprecate __method__, '.should.empty?'
1819
BeEmptyMatcher.new
1920
end
2021
end

lib/mspec/matchers/be_false.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def negative_failure_message
1515

1616
module MSpecMatchers
1717
private def be_false
18+
MSpec.deprecate __method__, '.should == false'
1819
BeFalseMatcher.new
1920
end
2021
end

lib/mspec/matchers/be_kind_of.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def negative_failure_message
1919

2020
module MSpecMatchers
2121
private def be_kind_of(expected)
22+
MSpec.deprecate __method__, '.should.is_a?'
2223
BeKindOfMatcher.new(expected)
2324
end
2425
end

lib/mspec/matchers/be_nan.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def negative_failure_message
1515

1616
module MSpecMatchers
1717
private def be_nan
18+
MSpec.deprecate __method__, '.should.nan?'
1819
BeNaNMatcher.new
1920
end
2021
end

lib/mspec/matchers/be_nil.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def negative_failure_message
1515

1616
module MSpecMatchers
1717
private def be_nil
18+
MSpec.deprecate __method__, '.should == nil'
1819
BeNilMatcher.new
1920
end
2021
end

lib/mspec/matchers/be_true.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def negative_failure_message
1515

1616
module MSpecMatchers
1717
private def be_true
18+
MSpec.deprecate __method__, '.should == true'
1819
BeTrueMatcher.new
1920
end
2021
end

lib/mspec/matchers/eql.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def negative_failure_message
2121

2222
module MSpecMatchers
2323
private def eql(expected)
24+
MSpec.deprecate __method__, '.should.eql?'
2425
EqlMatcher.new(expected)
2526
end
2627
end

0 commit comments

Comments
 (0)