Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit e492850

Browse files
committed
Fix specs for 1.8.7
1 parent 9eb8906 commit e492850

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spec/rspec/mocks/any_instance_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,16 +1078,17 @@ def foo; end
10781078

10791079
let(:object) { klass.new }
10801080

1081+
# The map(&:to_sym) is for legacy Ruby compatability and can be dropped in RSpec 4
10811082
it "maintains the method in the list of private_methods" do
10821083
expect {
10831084
verify_all
1084-
}.to_not change { object.private_methods.include?(:private_method) }.from(true)
1085+
}.to_not change { object.private_methods.map(&:to_sym).include?(:private_method) }.from(true)
10851086
end
10861087

10871088
it "maintains the methods exclusion from the list of public_methods" do
10881089
expect {
10891090
verify_all
1090-
}.to_not change { object.public_methods.include?(:private_method) }.from(false)
1091+
}.to_not change { object.public_methods.map(&:to_sym).include?(:private_method) }.from(false)
10911092
end
10921093

10931094
it "maintains the methods visibility" do
@@ -1129,7 +1130,7 @@ def foo; end
11291130

11301131
it "restores a stubbed private method after the spec is run" do
11311132
expect(klass.private_method_defined?(:private_method)).to be_truthy
1132-
expect(klass.new.private_methods).to include :private_method
1133+
expect(klass.new.private_methods.map(&:to_sym)).to include :private_method
11331134
end
11341135

11351136
it "ensures that the restored method behaves as it originally did" do

0 commit comments

Comments
 (0)