Sha256: 196665de12f8e12f503c3e52ec786e00af8a3bd14be3df6a086d0215f5c307ce

Contents?: true

Size: 781 Bytes

Versions: 5

Compression:

Stored size: 781 Bytes

Contents

require "test_helper"

# class A used elsewhere => use AA
class AA
  include ActWithBooleans
end

# dito
class BB
  include ActWithBooleans
end

# dito
class CC
  include ActWithBooleans
end

describe "Testing origin" do
  it "checks default origin :booleans" do
    assert_raises { AA.act_with_booleans.origin }
    AA.add_to_booleans
    assert_equal :booleans, AA.act_with_booleans.origin
  end

  it "checks origin set to :origin" do
    BB.add_to_booleans origin: :origin
    assert_equal :origin, BB.act_with_booleans.origin
    assert_raises { BB.act_with_booleans origin: :origin2 }
  end

  it "rejects a second origin" do
    CC.add_to_booleans
    assert_equal :booleans, CC.act_with_booleans.origin
    assert_raises { CC.act_with_booleans origin: :origin2 }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
act_with_booleans-0.0.5 test/origin_test.rb
act_with_booleans-0.0.4 test/origin_test.rb
act_with_booleans-0.0.3 test/origin_test.rb
act_with_booleans-0.0.2 test/origin_test.rb
act_with_booleans-0.0.1 test/origin_test.rb