Sha256: e69f4c33c44fd24beaf9c96ec8fb32976cfc5c137db5ef221af4799085689eeb

Contents?: true

Size: 897 Bytes

Versions: 14

Compression:

Stored size: 897 Bytes

Contents

require 'spec_helper'
require 'puppet/pops'

describe "Hiera2 YAML backend" do

  include PuppetSpec::Files

  def fixture_dir(config_name)
    my_fixture("#{config_name}")
  end

  before(:all) do
    Puppet[:binder] = true
    require 'puppetx'
    require 'puppet/pops/binder/hiera2/yaml_backend'
  end

  after(:all) do
    Puppet[:binder] = false
  end

  it "returns the expected hash from a valid yaml file" do
    Puppet::Pops::Binder::Hiera2::YamlBackend.new().read_data(fixture_dir("ok"), "common").should == {'brillig' => 'slithy'}
  end

  it "returns an empty hash from an empty yaml file" do
    Puppet::Pops::Binder::Hiera2::YamlBackend.new().read_data(fixture_dir("empty"), "common").should == {}
  end

  it "returns an empty hash from an invalid yaml file" do
    Puppet::Pops::Binder::Hiera2::YamlBackend.new().read_data(fixture_dir("invalid"), "common").should == {}
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
puppet-3.4.3 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb
puppet-3.4.2 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb
puppet-3.4.1 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb
puppet-3.4.0 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb
puppet-3.4.0.rc2 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb
puppet-3.4.0.rc1 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb
puppet-3.3.2 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb
puppet-3.3.1 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb
puppet-3.3.1.rc3 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb
puppet-3.3.1.rc2 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb
puppet-3.3.1.rc1 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb
puppet-3.3.0 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb
puppet-3.3.0.rc3 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb
puppet-3.3.0.rc2 spec/unit/pops/binder/hiera2/yaml_backend_spec.rb