Sha256: c07c08ad95d9e1da2be6efdd6b924e4b2b4337f6022e2850cf25e17f55bc7b45

Contents?: true

Size: 973 Bytes

Versions: 17

Compression:

Stored size: 973 Bytes

Contents

require 'spec_helper'

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

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
whowish_word-0.2.7 spec/unit/word_for_attr_spec.rb
whowish_word-0.2.6 spec/unit/word_for_attr_spec.rb
whowish_word-0.2.5 spec/unit/word_for_attr_spec.rb
whowish_word-0.2.3 spec/unit/word_for_attr_spec.rb
whowish_word-0.2.2 spec/unit/word_for_attr_spec.rb
whowish_word-0.2.1 spec/unit/word_for_attr_spec.rb
whowish_word-0.2.0 spec/unit/word_for_attr_spec.rb
whowish_word-0.1.9 spec/unit/word_for_attr_spec.rb
whowish_word-0.1.8 spec/unit/word_for_attr_spec.rb
whowish_word-0.1.7 spec/unit/word_for_attr_spec.rb
whowish_word-0.1.6 spec/unit/word_for_attr_spec.rb
whowish_word-0.1.5 spec/unit/word_for_attr_spec.rb
whowish_word-0.1.4 spec/unit/word_for_attr_spec.rb
whowish_word-0.1.3 spec/unit/word_for_attr_spec.rb
whowish_word-0.1.2 spec/unit/word_for_attr_spec.rb
whowish_word-0.1.1 spec/unit/word_for_attr_spec.rb
whowish_word-0.1.0 spec/unit/word_for_attr_spec.rb