Sha256: 2c04682f0a45023b5144660a6db53e012100bf9d61fa2c099e904bd6e19acbdb

Contents?: true

Size: 616 Bytes

Versions: 1

Compression:

Stored size: 616 Bytes

Contents

require_relative "../test_helper"
require "stig"
require "stig/generators/float"

include Stig

setup { Stig::Generators::Float }

test "takes a maximum value" do |mod|
  generator = generator_for(mod, 10.0)

  property(generator) do |integer|
    assert integer.between?(0.0, 10.0)

    true
  end
end

test "takes a range" do |mod|
  generator = generator_for(mod, 5.0..10.0)

  property(generator) do |integer|
    assert integer.between?(5.0, 10.0)

    true
  end
end

test "defaults to Floats between 0.0 and 1.0" do |mod|
  property(mod) do |integer|
    assert integer.between?(0.0, 1.0)

    true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stig-0.1.0 test/stig/float_generator.rb