Sha256: 25da0f6002194b797dad80538c72f2d1f4acdbfd32b4bbdf76fdd602d90f4979

Contents?: true

Size: 952 Bytes

Versions: 2

Compression:

Stored size: 952 Bytes

Contents

require 'spec_helper'

describe 'word_for' do
  
  before(:each) do
    WhowishWord.words = {}
  end
  
  
  it "no variables, no entry" do
    
    value = WhowishWord.word_for("namespace", "id", "en")
    value.should == "id(en)"
    
  end
  
  
  it "with variables, no entry" do
    
    value = WhowishWord.word_for("namespace", "id", "en", :number=>5, :name=>"tanin")
    value.should == "id(en){number,name}"
    
  end
  
  
  it "no variables, with entry" do
    
    WhowishWord.words = {"namespace:id(en)" => "hello"}
    value = WhowishWord.word_for("namespace", "id", "en")
    value.should == "hello"
    
  end
  
  
  it "with variables, with entry" do
    
    WhowishWord.words = {"namespace:id(en)" => "hello {name} for {number} times"}
    value = WhowishWord.word_for("namespace", "id", "en", :number=>5, :name=>"tanin")
    value.should == "hello tanin for 5 times"
    
  end
  
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
whowish_word-0.3.1 spec/unit/word_for_spec.rb
whowish_word-0.3.0 spec/unit/word_for_spec.rb