Sha256: 48a24cd6660c6b63c7f478470a8bbced96f56960fbc6d9c3202d4a53c7e6d116

Contents?: true

Size: 904 Bytes

Versions: 9

Compression:

Stored size: 904 Bytes

Contents

require 'spec/spec_helper'

default_setup
class IncludeTest
  include FastGettext::Translation
  @@xx = _('car')
  def self.ext
    _('car')
  end
  def inc
    _('car')
  end
  def self.xx
    @@xx
  end
end

describe FastGettext do
  include FastGettext
  before :all do
    default_setup
  end

  it "provides access to FastGettext::Translations methods" do
    FastGettext._('car').should == 'Auto'
    _('car').should == 'Auto'
    s_("XXX|not found").should == "not found"
    n_('Axis','Axis',1).should == 'Achse'
    N_('XXXXX').should == 'XXXXX'
    Nn_('X','Y').should == ['X','Y']
  end
  
  it "is extended to a class and included into a class" do
    IncludeTest.ext.should == 'Auto'
    IncludeTest.ext.should == 'Auto'
    IncludeTest.new.inc.should == 'Auto'
    IncludeTest.xx.should == 'Auto'
  end

  it "has a VERSION" do
    FastGettext::VERSION.should =~ /^\d+\.\d+\.\d+$/
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fast_gettext-0.5.10 spec/fast_gettext_spec.rb
fast_gettext-0.5.9 spec/fast_gettext_spec.rb
fast_gettext-0.5.8 spec/fast_gettext_spec.rb
fast_gettext-0.5.7 spec/fast_gettext_spec.rb
fast_gettext-0.5.6 spec/fast_gettext_spec.rb
fast_gettext-0.5.5 spec/fast_gettext_spec.rb
fast_gettext-0.5.4 spec/fast_gettext_spec.rb
fast_gettext-0.5.3 spec/fast_gettext_spec.rb
fast_gettext-0.5.2 spec/fast_gettext_spec.rb