Sha256: 8ca91e2619d385f460cb92546e5bee03e66de67eb8c8fb89e134f583cbc2fe60

Contents?: true

Size: 924 Bytes

Versions: 6

Compression:

Stored size: 924 Bytes

Contents

require 'spec_helper'

describe Isomer::Sources do
  describe '.factory' do
    context 'with a source of :yaml' do
      it 'uses the yaml source' do
        Isomer::Sources::Yaml.
          should_receive(:new).
          with([], path: '/tmp/foo/bar.yml', base: 'development')

        Isomer::Sources.factory(:yaml, [], path: '/tmp/foo/bar.yml', base: 'development')
      end
    end

    context 'with a source of :environment' do
      it 'uses the environment source' do
        Isomer::Sources::Environment.
          should_receive(:new).
          with([], prefix: 'APP_')

        Isomer::Sources.factory(:environment, [], prefix: 'APP_')
      end
    end

    context 'with a source of :test' do
      it 'uses the test source' do
        Isomer::Sources::Test.
          should_receive(:new).
          with([], payload: {})

        Isomer::Sources.factory(:test, [], payload: {})
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
isomer-0.1.4 spec/isomer/sources_spec.rb
isomer-0.1.3 spec/isomer/sources_spec.rb
isomer-0.1.2 spec/isomer/sources_spec.rb
isomer-0.1.1 spec/isomer/sources_spec.rb
isomer-0.1.0 spec/isomer/sources_spec.rb
isomer-0.0.1 spec/isomer/sources_spec.rb