[rspec-devel] [ rspec-Bugs-14475 ] Tempfile doesn't pass be_an_instance_of(Tempfile). Maybe becouse it use decorator

noreply at rubyforge.org noreply at rubyforge.org
Fri Oct 5 06:40:04 EDT 2007


Bugs item #14475, was opened at 2007-10-05 13:40
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=14475&group_id=797

Category: expectation module
Group: v1.0 (example)
Status: Open
Resolution: None
Priority: 3
Submitted By: Serhiy Boiko (cris)
Assigned to: Nobody (None)
Summary: Tempfile doesn't pass be_an_instance_of(Tempfile). Maybe becouse it use decorator

Initial Comment:
describe "My problem" do

  it "should pass be_an_instance_of for newly created Tempfile" do
    # create test object
    xml_tempfile = Tempfile.new "object.xml"
    xml_tempfile.close
    # this kind of test passed normally
    xml_tempfile.class.should eql(Tempfile)
    # this doesn't pass
    xml_tempfile.should be_an_instance_of(Tempfile)
  end
end

In ruby-debug I found, that in validation stage, object become instance of File. Maybe something unwrap Delegator in Tempfile?

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=14475&group_id=797


More information about the rspec-devel mailing list