Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

49 lines (42 sloc) 1.088 kB
require "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 "loads 3-letter locales as well" do
FastGettext.locale = 'gsw_CH'
FastGettext._('Car was successfully created.').should == "Z auto isch erfolgriich gspeicharat worda."
end
it "has a VERSION" do
FastGettext::VERSION.should =~ /^\d+\.\d+\.\d+$/
end
end
Jump to Line
Something went wrong with that request. Please try again.