Sha256: f16f8dc51c60dff7bd3705c5f864af971956339dcdaf5083b1e9fc2e8fcbffb5
Contents?: true
Size: 973 Bytes
Versions: 52
Compression:
Stored size: 973 Bytes
Contents
require File.expand_path('../../../../spec_helper', __FILE__) require File.expand_path('../../fixtures/classes', __FILE__) describe :method_to_s, :shared => true do before :each do @m = MethodSpecs::MySub.new.method :bar @string = @m.send(@method).sub(/0x\w+/, '0xXXXXXX') end it "returns a String" do @m.send(@method).should be_kind_of(String) end it "returns a String for methods defined with attr_accessor" do m = MethodSpecs::Methods.new.method :attr m.send(@method).should be_kind_of(String) end it "returns a String containing 'Method'" do @string.should =~ /\bMethod\b/ end it "returns a String containing the method name" do @string.should =~ /\#bar/ end it "returns a String containing the Module the method is defined in" do @string.should =~ /MethodSpecs::MyMod/ end it "returns a String containing the Module the method is referenced from" do @string.should =~ /MethodSpecs::MySub/ end end
Version data entries
52 entries across 52 versions & 2 rubygems