Sha256: 1ca1efdca519acb171c3a4879b3fe700d3eafc10e56241f8fb883825481a68a3

Contents?: true

Size: 424 Bytes

Versions: 4

Compression:

Stored size: 424 Bytes

Contents

require File.dirname(__FILE__) + '/../../../spec_helper.rb'

context "should_not_have_key" do
  specify "should pass when key is not present" do
    lambda do
      {"a" => 1}.should_not_have_key("b")
    end.should_not_raise
  end

  specify "should fail when key is present" do
    lambda do
      {"a" => 1}.should_not_have_key("a")
    end.should_fail_with('expected #has_key?("a") to return false, got true')
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
riess-0.0.8 vendor/rspec-0.8.2/spec/spec/expectations/should/should_not_have_key_spec.rb
rspec-0.8.0 spec/spec/expectations/should/should_not_have_key_spec.rb
rspec-0.8.1 spec/spec/expectations/should/should_not_have_key_spec.rb
rspec-0.8.2 spec/spec/expectations/should/should_not_have_key_spec.rb