Sha256: f9eb191f627be29e2f907539b9ff67ba43ce988b2be3ca99f52ae2356aa3daef

Contents?: true

Size: 792 Bytes

Versions: 7

Compression:

Stored size: 792 Bytes

Contents

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

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

  it "should exist" do
    Puppet::Parser::Functions.function("is_float").should == "function_is_float"
  end

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

  it "should return true if a float" do
    result = scope.function_is_float(["0.12"])
    result.should(eq(true))
  end

  it "should return false if a string" do
    result = scope.function_is_float(["asdf"])
    result.should(eq(false))
  end

  it "should return false if an integer" do
    result = scope.function_is_float(["3"])
    result.should(eq(false))
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
service_kiosk-0.5.6 provision/modules/stdlib/spec/unit/puppet/parser/functions/is_float_spec.rb
service_kiosk-0.5.5 provision/modules/stdlib/spec/unit/puppet/parser/functions/is_float_spec.rb
service_kiosk-0.5.4 provision/modules/stdlib/spec/unit/puppet/parser/functions/is_float_spec.rb
service_kiosk-0.5.3 provision/modules/stdlib/spec/unit/puppet/parser/functions/is_float_spec.rb
service_kiosk-0.5.2 provision/modules/stdlib/spec/unit/puppet/parser/functions/is_float_spec.rb
service_kiosk-0.5.1 provision/modules/stdlib/spec/unit/puppet/parser/functions/is_float_spec.rb
service_kiosk-0.5.0 provision/modules/stdlib/spec/unit/puppet/parser/functions/is_float_spec.rb