Sha256: e747f464bf3c1e43a517c1e0e054e0975743f67d5cffb53810a2a11a5440aa34

Contents?: true

Size: 717 Bytes

Versions: 3

Compression:

Stored size: 717 Bytes

Contents

require "test_helper"

describe "Internal Null" do
  let(:admin) { Order.act_with_flags }

  def setup
    reset_order
    Order.add_to_flags
  end

  it "respond to act_with_flags" do
    assert Order.respond_to?(:act_with_flags)
    refute_nil Order.act_with_flags
  end

  it "tests to_boolean" do
    assert admin.to_boolean(true)
    assert admin.to_boolean("true")
    assert admin.to_boolean(1)
    assert admin.to_boolean("1")
    refute admin.to_boolean(false)
    refute admin.to_boolean("false")
    refute admin.to_boolean(0)
    refute admin.to_boolean("0")
    assert_raises { admin.to_boolean(nil) }
    assert_raises { admin.to_boolean(2) }
    assert_raises { admin.to_boolean("unknown") }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
act_with_flags-3.1.1 test/coding_null_test.rb
act_with_flags-3.1.0 test/coding_null_test.rb
act_with_flags-3.0.1 test/coding_null_test.rb