Sha256: 4a1ddc3a37135b9e5140c3c581ad541bc998b14a8ef2d27be21db05503339d11

Contents?: true

Size: 856 Bytes

Versions: 24

Compression:

Stored size: 856 Bytes

Contents

require File.expand_path("spec_helper", File.dirname(__FILE__))

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

include FastGettext

describe FastGettext do
  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
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
grosser-fast_gettext-0.2.11 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.3.0 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.3.1 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.3.2 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.3.3 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.3.4 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.3.5 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.3.6 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.3.7 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.3.8 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.4.0 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.4.10 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.4.11 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.4.12 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.4.13 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.4.14 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.4.15 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.4.2 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.4.3 spec/fast_gettext_spec.rb
grosser-fast_gettext-0.4.4 spec/fast_gettext_spec.rb