Sha256: dc91441587f4f32f128a7b44d84c82a5782d4321cd557e983356db8377cb0e12

Contents?: true

Size: 604 Bytes

Versions: 105

Compression:

Stored size: 604 Bytes

Contents

require 'rspec'

# This is necessary because the RAL has a 'should' method.
class Object
  alias :must :should
  alias :must_not :should_not
end

# ...and this is because we want to make sure we don't ignore that change
# above.  Gotta love overwriting functions, but the performance cost at
# runtime is pretty terrible if we don't.
require 'puppet/type'
class Puppet::Type
  alias :should_native :should
  def should(value)
    unless value.is_a? String or value.is_a? Symbol
      raise "you need to call .must rather than .should on Puppet::Type instances"
    end
    should_native(value)
  end
end

Version data entries

105 entries across 105 versions & 2 rubygems

Version Path
puppet-3.8.7 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.7-x86-mingw32 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.7-x64-mingw32 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.6 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.6-x86-mingw32 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.6-x64-mingw32 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.5 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.5-x86-mingw32 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.5-x64-mingw32 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.4 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.4-x86-mingw32 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.4-x64-mingw32 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.3 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.3-x86-mingw32 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.3-x64-mingw32 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.2 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.2-x86-mingw32 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.2-x64-mingw32 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.1 spec/monkey_patches/alias_should_to_must.rb
puppet-3.8.1-x86-mingw32 spec/monkey_patches/alias_should_to_must.rb