Sha256: d453af9bc548088a7dcaa71593d70bd76a7ea1cc14c44b09135c8afac5b9be14

Contents?: true

Size: 600 Bytes

Versions: 2

Compression:

Stored size: 600 Bytes

Contents

require "spec_helper"

describe Configuration::Syntax::Conf do
  let(:files) { ["config/file_a.yml", "config/file_b.yml"] }
  let(:file_a) { { "key_a" => "value_a" } }
  let(:file_b) { { "key_b" => "value_b" } }

  before do
    Dir.stub(:glob).and_return(files)
    YAML.stub(:load_file).and_return(file_a, file_b)
  end

  it "provides an interface to access yml config files" do
    Conf.file_a[:key_a].should be_eql "value_a"
    Conf.file_b[:key_b].should be_eql "value_b"
  end

  it "doesn't provide an interface to access other attributes" do
    Conf.files.should_not be_eql files
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
config_yml-0.0.7 spec/lib/configuration/syntax/conf_spec.rb
config_yml-0.0.6 spec/lib/configuration/syntax/conf_spec.rb