Sha256: 0ae388cf3e39525b0df0cd1bd2978f24ad2787e75db5913c6112eaddbd7fb7c5
Contents?: true
Size: 1.08 KB
Versions: 18
Compression:
Stored size: 1.08 KB
Contents
current_folder = File.dirname(__FILE__) require File.join(current_folder,'..','..','spec_helper') describe 'FastGettext::TranslationRepository::Logger' do before do @callback = lambda{} @rep = FastGettext::TranslationRepository.build('test', :type=>:logger, :callback=>@callback) @rep.is_a?(FastGettext::TranslationRepository::Logger).should be_true end subject{@rep} it{ should have(0).available_locales} it "has no pluralisation_rule" do @rep.pluralisation_rule.should == nil end describe :single do it "logs every call" do @callback.should_receive(:call).with('the_key') @rep['the_key'] end it "returns nil" do @callback.should_receive(:call).with('the_key').and_return 'something' @rep['the_key'].should == nil end end describe :plural do it "logs every call" do @callback.should_receive(:call).with(['a','b']) @rep.plural('a','b') end it "returns an empty array" do @callback.should_receive(:call).with(['a','b']).and_return 'something' @rep.plural('a','b').should == [] end end end
Version data entries
18 entries across 18 versions & 2 rubygems