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

Version Path
epitools-0.4.49 spec/rash_spec.rb
epitools-0.4.48 spec/rash_spec.rb
epitools-0.4.47 spec/rash_spec.rb
epitools-0.4.46 spec/rash_spec.rb
epitools-0.4.45 spec/rash_spec.rb
epitools-0.4.44 spec/rash_spec.rb
epitools-0.4.43 spec/rash_spec.rb
epitools-0.4.42 spec/rash_spec.rb
epitools-0.4.41 spec/rash_spec.rb
epitools-0.4.40 spec/rash_spec.rb
epitools-0.4.39 spec/rash_spec.rb
epitools-0.4.38 spec/rash_spec.rb
epitools-0.4.37 spec/rash_spec.rb
epitools-0.4.36 spec/rash_spec.rb
epitools-0.4.35 spec/rash_spec.rb
epitools-0.4.34 spec/rash_spec.rb
epitools-0.4.33 spec/rash_spec.rb
epitools-0.4.32 spec/rash_spec.rb
epitools-0.4.31 spec/rash_spec.rb
epitools-0.4.30 spec/rash_spec.rb