Sha256: ca6c11322cad18f1271d88e96491a5008e8c73eede1495e6c303a2adbc3ba9f4

Contents?: true

Size: 882 Bytes

Versions: 150

Compression:

Stored size: 882 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
    expect([[]].join(":")).to eq("")
    expect(["1", []].join(":")).to eq("1:")
  end
end

Version data entries

150 entries across 150 versions & 1 rubygems

Version Path
puppet-4.10.12 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.12-x86-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.12-x64-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.12-universal-darwin spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.11 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.11-x86-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.11-x64-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.11-universal-darwin spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.10 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.10-x86-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.10-x64-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.10-universal-darwin spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.9 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.9-x86-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.9-x64-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.9-universal-darwin spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.8 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.8-x86-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.8-x64-mingw32 spec/unit/pops/parser/rgen_sanitycheck_spec.rb
puppet-4.10.8-universal-darwin spec/unit/pops/parser/rgen_sanitycheck_spec.rb