Sha256: b3db99879fe9c3bd546d6c325ecea72ca02af6ab414d1a73a5ebc58bc57370bc
Contents?: true
Size: 645 Bytes
Versions: 64
Compression:
Stored size: 645 Bytes
Contents
require 'epitools/rash' describe Rash do attr_accessor :r before :each do @r = Rash.new( /hello/ => "hello", /world/ => "world", "other" => "whee", true => false, 1 => "awesome" # /.+/ => "EVERYTHING" ) end it "string lookups" do r["other"].should == "whee" r["well hello there"].should == ["hello"] r["the world is round"].should == ["world"] r["hello world"].sort.should == ["hello", "world"] end it "regex lookups" do r[/other/].should == ["whee"] end it "other objects" do r[true].should == false r[1].should == "awesome" end end
Version data entries
64 entries across 64 versions & 1 rubygems