[rspec-devel] [ rspec-Feature Requests-6334 ] should_have_key

noreply at rubyforge.org noreply at rubyforge.org
Thu Oct 26 08:23:01 EDT 2006


Feature Requests item #6334, was opened at 2006-10-26 12:22
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6334&group_id=797

Category: expectation module
Group: None
>Status: Closed
Priority: 3
Submitted By: David Chelimsky (dchelimsky)
Assigned to: David Chelimsky (dchelimsky)
Summary: should_have_key

Initial Comment:
context "should_have_key" do
  specify "should pass when key is present" do
    lambda do
      {"a" => 1}.should_have_key("a")
    end.should_not_raise
  end

  specify "should fail when key is not present" do
    lambda do
      {"a" => 1}.should_have_key("b")
    end.should_fail_with '<{"a"=>1}> should have key: "b"'
  end
end


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

>Comment By: David Chelimsky (dchelimsky)
Date: 2006-10-26 12:23

Message:
Added - will be in 0.7

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

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


More information about the rspec-devel mailing list