Sha256: 094468c5748b651b7fa7e2c364ebd4512910c1229ce36c375e1a7dea1b998856

Contents?: true

Size: 1.04 KB

Versions: 19

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'
require 'complex_config/plugins/enable'

RSpec.describe ComplexConfig::Plugins do
  let :provider do
    ComplexConfig::Provider
  end

  let :settings do
    ComplexConfig::Settings[
      foo: {
        test_url:      'http://www.ping.de',
        cash_in_cents: 100.to_money.cents
      }
    ]
  end

  context described_class::URI do
    it 'can return an URL string' do
      expect(settings.foo.test_url).to eq 'http://www.ping.de'
    end

    it 'can return an URI' do
      expect(settings.foo.test_uri).to eq URI.parse('http://www.ping.de')
    end

    it 'can return an URI' do
      expect(settings.foo[:test_uri]).to eq URI.parse('http://www.ping.de')
    end

    it 'can skips if blub' do
      expect { settings.foo.nix_uri }.to raise_error(ComplexConfig::AttributeMissing)
    end
  end

  context described_class::MONEY do
    it 'can return a Fixnum' do
      expect(settings.foo.cash_in_cents).to eq 100_00
    end

    it 'can return a Money instance' do
      expect(settings.foo.cash).to eq 100.to_money
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
complex_config-0.22.0 spec/complex_config/plugins_spec.rb
complex_config-0.21.2 spec/complex_config/plugins_spec.rb
complex_config-0.21.1 spec/complex_config/plugins_spec.rb
complex_config-0.21.0 spec/complex_config/plugins_spec.rb
complex_config-0.20.0 spec/complex_config/plugins_spec.rb
complex_config-0.19.4 spec/complex_config/plugins_spec.rb
complex_config-0.19.3 spec/complex_config/plugins_spec.rb
complex_config-0.19.2 spec/complex_config/plugins_spec.rb
complex_config-0.19.1 spec/complex_config/plugins_spec.rb
complex_config-0.19.0 spec/complex_config/plugins_spec.rb
complex_config-0.18.2 spec/complex_config/plugins_spec.rb
complex_config-0.18.1 spec/complex_config/plugins_spec.rb
complex_config-0.18.0 spec/complex_config/plugins_spec.rb
complex_config-0.17.1 spec/complex_config/plugins_spec.rb
complex_config-0.17.0 spec/complex_config/plugins_spec.rb
complex_config-0.16.0 spec/complex_config/plugins_spec.rb
complex_config-0.15.1 spec/complex_config/plugins_spec.rb
complex_config-0.15.0 spec/complex_config/plugins_spec.rb
complex_config-0.14.1 spec/complex_config/plugins_spec.rb