Sha256: fc20b1b4c8143cdee1252cb39ecc92eb02f17d50ac5f01ad14afc6009997f682

Contents?: true

Size: 610 Bytes

Versions: 1

Compression:

Stored size: 610 Bytes

Contents

require "spec_helper"

module RockConfig
  describe YamlLoader do
    it "loads config when given valid path and filename" do
      directory = File.join(Dir.pwd, "spec", "fixtures") 

      loader = YamlLoader.new
      config = loader.find_at(directory, "database")

      config.should_not be_nil
    end

    it "throws exception when given valid path to an invalid file" do
      directory = File.join(Dir.pwd, "spec", "fixtures") 
      loader = YamlLoader.new

      expect do
        config = loader.find_at(directory, "database_invalid")
      end.to raise_error(Psych::SyntaxError)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rock_config-0.0.1 spec/yaml_loader_spec.rb