Sha256: 76084183831db145deff212b62e21ef4c3b927fac279f6e0f90a5d74153c34d6

Contents?: true

Size: 872 Bytes

Versions: 74

Compression:

Stored size: 872 Bytes

Contents

#! /usr/bin/env ruby
require 'spec_helper'
require 'puppet/pops'

require 'rgen/array_extensions'

describe "RGen extensions to core classes" do
  it "should be possible to create an empty hash after having required the files above" do
    # If this fails, it means the rgen addition to Array is not monkey patched as it
    # should (it will return an array instead of fail in a method_missing), and thus
    # screw up Hash's check if it can do "to_hash' or not.
    #
    Hash[[]]
  end

  it "should be possible to automatically stringify a nested, empty array during join" do
    # When this fails it means that rgen has incorrectly implemented
    # method_missing on array and is returning an array for to_str instead of
    # failing as is expected allowing stringification to occur
    [[]].join(":").should == ""
    ["1", []].join(":").should == "1:"
  end
end

Version data entries

74 entries across 74 versions & 1 rubygems

Version Path
puppet-3.8.7 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.7-x86-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.7-x64-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.6 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.6-x86-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.6-x64-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.5 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.5-x86-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.5-x64-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.4 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.4-x86-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.4-x64-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.3 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.3-x86-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.3-x64-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.2 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.2-x86-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.2-x64-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.1 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-3.8.1-x86-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb