Sha256: afe041bb88cc2260b64fbe14e130e4bc22e3e7db86ea493ad1c0bf58138317eb

Contents?: true

Size: 474 Bytes

Versions: 9

Compression:

Stored size: 474 Bytes

Contents

require File.join(File.dirname(__FILE__), "..", "spec_helper")

describe SafeYAML::Transform::ToFloat do
  it "returns true when the value matches a valid Float" do
    subject.transform?("20.00").should be_true
  end

  it "returns false when the value does not match a valid Float" do
    subject.transform?("foobar").should be_false
  end

  it "returns false when the value spans multiple lines" do
    subject.transform?("20.00\nNOT A FLOAT").should be_false
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
safe_yaml-0.8.3 spec/transform/to_float_spec.rb
safe_yaml-0.8.2 spec/transform/to_float_spec.rb
safe_yaml-0.8.1 spec/transform/to_float_spec.rb
safe_yaml-0.8.0 spec/transform/to_float_spec.rb
safe_yaml-0.7.1 spec/transform/to_float_spec.rb
safe_yaml-0.7.0 spec/transform/to_float_spec.rb
safe_yaml-0.6.3 spec/transform/to_float_spec.rb
safe_yaml-0.6.2 spec/transform/to_float_spec.rb
safe_yaml-0.6.1 spec/transform/to_float_spec.rb