File: configuration_spec.rb

package info (click to toggle)
ruby-humanize 2.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,108 kB
  • sloc: ruby: 1,779; makefile: 7; sh: 1
file content (27 lines) | stat: -rw-r--r-- 644 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require 'spec_helper'

module Humanize
  describe Configuration do
    after(:each) do
      Humanize.reset_config
    end

    describe "#default_locale" do
      it "default value is :en" do
        expect(Humanize.config.default_locale).to eq(:en)
      end

      it "value can be changed using a block" do
        Humanize.configure do |config|
          config.default_locale = :fr
        end
        expect(Humanize.config.default_locale).to eq(:fr)
      end

      it "value can be changed directly" do
        Humanize.config.default_locale = :fr
        expect(Humanize.config.default_locale).to eq(:fr)
      end
    end
  end
end