Sha256: e5b0b873b3e53799cf5559eb84c90659d89b1f0d05bd80da38b52fab2d6d289c
Contents?: true
Size: 1.02 KB
Versions: 42
Compression:
Stored size: 1.02 KB
Contents
require File.dirname(__FILE__) + '/../../spec_helper.rb' describe "should have_sym(*args)" do it "should pass if #has_sym?(*args) returns true" do {:a => "A"}.should have_key(:a) end it "should fail if #has_sym?(*args) returns false" do lambda { {:b => "B"}.should have_key(:a) }.should fail_with("expected #has_key?(:a) to return true, got false") end it "should fail if target does not respond to #has_sym?" do lambda { Object.new.should have_key(:a) }.should raise_error(NoMethodError) end end describe "should_not have_sym(*args)" do it "should pass if #has_sym?(*args) returns false" do {:a => "A"}.should_not have_key(:b) end it "should fail if #has_sym?(*args) returns true" do lambda { {:a => "A"}.should_not have_key(:a) }.should fail_with("expected #has_key?(:a) to return false, got true") end it "should fail if target does not respond to #has_sym?" do lambda { Object.new.should have_key(:a) }.should raise_error(NoMethodError) end end
Version data entries
42 entries across 42 versions & 6 rubygems