Sha256: 17b149c25eef1d22d6eb204bdc3f4289cfbef7b7470fbcde164f1317ca63479f
Contents?: true
Size: 1.39 KB
Versions: 17
Compression:
Stored size: 1.39 KB
Contents
require 'spec_helper' describe 'word_for' do before(:each) do WhowishWord.words = {} end it "no variables, no entry" do value = WhowishWord.word_for_in_edit_mode("namespace", "id") value.should == "<dfn>#{WhowishWord::PREFIX}#{WhowishWord::SEPARATOR}namespace:id(en)#{WhowishWord::SEPARATOR}namespace:id(en)</dfn>" end it "with variables, no entry" do value = WhowishWord.word_for_in_edit_mode("namespace", "id", :number=>5, :name=>"tanin") value.should == "<dfn>#{WhowishWord::PREFIX}#{WhowishWord::SEPARATOR}namespace:id(en)|number,name#{WhowishWord::SEPARATOR}namespace:id(en){number,name}</dfn>" end it "no variables, with entry" do WhowishWord.words = {"namespace:id(en)" => "hello"} value = WhowishWord.word_for_in_edit_mode("namespace", "id") value.should == "<dfn>#{WhowishWord::PREFIX}#{WhowishWord::SEPARATOR}namespace:id(en)#{WhowishWord::SEPARATOR}hello</dfn>" end it "with variables, with entry" do WhowishWord.words = {"namespace:id(en)" => "hello {name} for {number} times"} value = WhowishWord.word_for_in_edit_mode("namespace", "id", :number=>5, :name=>"tanin") value.should == "<dfn>#{WhowishWord::PREFIX}#{WhowishWord::SEPARATOR}namespace:id(en)|number,name#{WhowishWord::SEPARATOR}hello tanin for 5 times</dfn>" end end
Version data entries
17 entries across 17 versions & 1 rubygems