Sha256: 6d1d512cf262148e42af4d568d095c048ac9779827bb69b41418a240d266b349

Contents?: true

Size: 616 Bytes

Versions: 6

Compression:

Stored size: 616 Bytes

Contents

#! /usr/bin/env ruby -S rspec
require 'spec_helper'

describe "the parseyaml function" do
  let(:scope) { PuppetlabsSpec::PuppetInternals.scope }

  it "should exist" do
    expect(Puppet::Parser::Functions.function("parseyaml")).to eq("function_parseyaml")
  end

  it "should raise a ParseError if there is less than 1 arguments" do
    expect { scope.function_parseyaml([]) }.to( raise_error(Puppet::ParseError))
  end

  it "should convert YAML to a data structure" do
    yaml = <<-EOS
- aaa
- bbb
- ccc
EOS
    result = scope.function_parseyaml([yaml])
    expect(result).to(eq(['aaa','bbb','ccc']))
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
puppet-retrospec-0.12.1 spec/fixtures/modules/stdlib/spec/functions/parseyaml_spec.rb
puppet-retrospec-0.12.0 spec/fixtures/modules/stdlib/spec/functions/parseyaml_spec.rb
puppet-retrospec-0.11.0 spec/fixtures/modules/stdlib/spec/functions/parseyaml_spec.rb
puppet-retrospec-0.10.0 spec/fixtures/modules/stdlib/spec/functions/parseyaml_spec.rb
puppet-retrospec-0.9.1 spec/fixtures/modules/stdlib/spec/functions/parseyaml_spec.rb
puppet-retrospec-0.9.0 spec/fixtures/modules/stdlib/spec/functions/parseyaml_spec.rb