Sha256: 4fc97f42d3f427015b7d2b1e74052c6fddb0791ceb5911b1d320a53b4139698e
Contents?: true
Size: 1.58 KB
Versions: 83
Compression:
Stored size: 1.58 KB
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/common' describe "NoMethodError.new" do it "allows passing method args" do NoMethodError.new("msg","name","args").args.should == "args" end end describe "NoMethodError#args" do it "returns an empty array if the caller method had no arguments" do begin NoMethodErrorSpecs::NoMethodErrorB.new.foo rescue Exception => e e.args.should == [] end end it "returns an array with the same elements as passed to the method" do begin a = NoMethodErrorSpecs::NoMethodErrorA.new NoMethodErrorSpecs::NoMethodErrorB.new.foo(1,a) rescue Exception => e e.args.should == [1,a] e.args[1].object_id.should == a.object_id end end end describe "NoMethodError#message" do it "for an undefined method match /undefined method/" do begin NoMethodErrorSpecs::NoMethodErrorD.new.foo rescue Exception => e e.class.should == NoMethodError end end it "for an protected method match /protected method/" do begin NoMethodErrorSpecs::NoMethodErrorC.new.a_protected_method rescue Exception => e e.class.should == NoMethodError end end not_compliant_on :rubinius do it "for private method match /private method/" do begin NoMethodErrorSpecs::NoMethodErrorC.new.a_private_method rescue Exception => e e.class.should == NoMethodError e.message.match(/private method/).should_not == nil end end end end
Version data entries
83 entries across 83 versions & 1 rubygems