Skip to content

Commit

Permalink
add test for "Better Method#inspect" introduced in Ruby >= 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
lxxxvi authored and eregon committed Oct 8, 2020
1 parent bfd843a commit 7740446
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/method/shared/to_s.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
@string.should =~ /\#bar/
end

ruby_version_is "2.7" do
it "returns a String containing method arguments" do
m = MethodSpecs::Methods.new.method :two_req
m.send(@method).should =~ /\#two_req\(a, b\)/
end
end

it "returns a String containing the Module the method is defined in" do
@string.should =~ /MethodSpecs::MyMod/
end
Expand Down

0 comments on commit 7740446

Please sign in to comment.