Sha256: c8f99498362d74213fadbdab25d1560511421bfa9305f2e582c2b007a7ca7d15
Contents?: true
Size: 651 Bytes
Versions: 2
Compression:
Stored size: 651 Bytes
Contents
require 'rubygems' require 'humanize' require 'rspec' describe "Humanize" do require_relative 'tests' after(:each) do Humanize.reset_config end TESTS.each do |num, human| it "#{num} is #{human}" do expect(num.humanize).to eql(human) end end describe 'locale option' do it 'uses default locale' do Humanize.config.default_locale = :fr expect(42.humanize).to eql("quarante-deux".gsub(/ +/, ' ')) end it 'uses locale passed as argument if given' do Humanize.config.default_locale = :en expect(42.humanize(:locale => :fr)).to eql("quarante-deux".gsub(/ +/, ' ')) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
humanize-1.2.1 | spec/humanize_spec.rb |
humanize-1.2.0 | spec/humanize_spec.rb |