Sha256: e2da501ae620fd720e3c3827307b542c6e13874d5eb38696b7ee368d13d88c92

Contents?: true

Size: 761 Bytes

Versions: 3

Compression:

Stored size: 761 Bytes

Contents

require "test_helper"

describe "One Flag" do
  let(:bool) { :blocked }
  let(:order) { Order.new }

  def setup
    reset_order
    Order.add_to_booleans bool
  end

  it "checks defaults" do
    refute_equal true, order.blocked
    assert_equal false, order.blocked
    assert_equal false, order.blocked?
  end

  it "set :blocked" do
    order.blocked = true
    assert_equal true, order.blocked
    assert_equal true, order.blocked?

    order.blocked = "false"
    assert_equal false, order.blocked
    assert_equal false, order.blocked?
  end

  it "rejects redefining" do
    assert_raises { Order.add_to_booleans bool }
  end

  it "rejects redefining #2" do
    Order.add_to_booleans :berta
    assert_raises { Order.add_to_booleans :berta }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
act_with_booleans-0.0.5 test/one_test.rb
act_with_booleans-0.0.4 test/one_test.rb
act_with_booleans-0.0.3 test/one_test.rb