[rspec-devel] [ rspec-Bugs-12215 ] Misleading error message when passing string as first argument to raise_error

noreply at rubyforge.org noreply at rubyforge.org
Thu Jul 12 01:39:54 EDT 2007


Bugs item #12215, was opened at 2007-07-11 22:39
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=12215&group_id=797

Category: expectation module
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Brian Takita (btakita)
Assigned to: Nobody (None)
Summary: Misleading error message when passing string as first argument to raise_error

Initial Comment:
describe "An example with raise_error" do
    it "should provide a nice error message when passed a string as a first argument" do
      proc do
        proc do
          raise "foobar"
        end.should raise_error("Called 4 times. Expected at most 3 times.")
      end.should raise_error(ArgumentError, "raise_error expects an Exception Class as its first argument")
    end
end

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

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


More information about the rspec-devel mailing list