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

Commit e7a7270

Browse files
authored
Merge pull request #526 from petergoldstein/feature/fix_ruby_head
Guard undefs and use an object that implements :=~ in all Ruby versions for specs
2 parents 321dc72 + d304e89 commit e7a7270

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spec/rspec/support_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def foo
2222
http_request_class = Struct.new(:method, :uri)
2323

2424
proxy_class = Struct.new(:original) do
25-
undef :=~, :method
25+
undef :=~ if respond_to?(:=~)
26+
undef :method if respond_to?(:method)
2627
def method_missing(name, *args, &block)
2728
original.__send__(name, *args, &block)
2829
end
@@ -39,12 +40,12 @@ def method_missing(name, *args, &block)
3940
end
4041

4142
it 'fetches method definitions for proxy objects' do
42-
object = proxy_class.new([])
43+
object = proxy_class.new('abc')
4344
expect(Support.method_handle_for(object, :=~)).to be_a Method
4445
end
4546

4647
it 'fetches method definitions for proxy objects' do
47-
object = proxy_class.new([])
48+
object = proxy_class.new('abc')
4849
expect(Support.method_handle_for(object, :=~)).to be_a Method
4950
end
5051

0 commit comments

Comments
 (0)