Sha256: aa0609479d7135698faf219e23fc5599b5c026d38cf85039775cd2651c73d1bb
Contents?: true
Size: 903 Bytes
Versions: 65
Compression:
Stored size: 903 Bytes
Contents
require "spec_helper" describe SC::HashStruct, 'has_options?' do include SC::SpecHelpers before do @hash = SC::HashStruct.new :foo => :foo, :bar => :bar end it "always returns true if passed match is empty or nil" do @hash.has_options?.should be_true @hash.has_options?({}).should be_true end it "returns true if every key/value pair in passed value set matches" do @hash.has_options?(:foo => :foo, :bar => :bar).should be_true end it "returns false if any key/value pair in passed value set does not match" do @hash.has_options?(:foo => :foo, :bar => :no_match).should be_false end it "returns false if any key/value pair does not exist in hash" do @hash.has_options?(:imaginary => true).should be_false end it "returns treats strings + symbols the same for keys" do @hash.has_options?('foo' => :foo, 'bar' => :bar).should be_true end end
Version data entries
65 entries across 65 versions & 1 rubygems