Sha256: 26f7aec28e3389918d74e2082db3b39beee6f946cacf7d596d7f39089ce472c9

Contents?: true

Size: 925 Bytes

Versions: 14

Compression:

Stored size: 925 Bytes

Contents

require 'spec_helper'

RSpec.describe Humanize, "az locale" do
  before do
    Humanize.configure do |config|
      config.default_locale = :az
    end
  end

  tests = [
    [8.15, 'səkkiz vergül bir beş'],
    [1002, 'min iki'],
    [2001, 'iki min bir'],
    [10_000, 'on min']
  ]

  tests.each do |num, output|
    it "#{num} equals #{output}" do
      expect(num.humanize).to eql(output)
    end
  end

  context 'decimals: number' do
    it 'returns the decimals as whole numbers' do
      num = 8.15
      expect(num.humanize(decimals_as: :number)).to eq('səkkiz vergül on beş')
    end
  end

  describe 'when called on conceptual number' do
    it 'reads correctly' do
      inf = Float::INFINITY
      neg_inf = -inf
      nan = inf + neg_inf

      expect(inf.humanize).to eql('sonsuz')
      expect(neg_inf.humanize).to eql('mənfi sonsuz')
      expect(nan.humanize).to eql('undefined')
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
humanize-3.0.0 spec/locales/az_spec.rb
humanize-2.5.1 spec/locales/az_spec.rb
humanize-2.5.0 spec/locales/az_spec.rb
humanize-2.4.3 spec/locales/az_spec.rb
humanize-2.4.2 spec/locales/az_spec.rb
humanize-2.4.1 spec/locales/az_spec.rb
humanize-2.4.0 spec/locales/az_spec.rb
humanize-2.3.0 spec/locales/az_spec.rb
humanize-2.2.1 spec/locales/az_spec.rb
humanize-2.2.0 spec/locales/az_spec.rb
humanize-2.1.2 spec/locales/az_spec.rb
humanize-2.1.1 spec/locales/az_spec.rb
humanize-2.1.0 spec/locales/az_spec.rb
humanize-2.0.0 spec/locales/az_spec.rb