Sha256: d3975f0b79e914d7f2ef4d60ed9186da33f91e2bb548f00f0328f3a9defef327
Contents?: true
Size: 1.22 KB
Versions: 25
Compression:
Stored size: 1.22 KB
Contents
require "helper" class TestStateTransition < Test::Unit::TestCase test "should set from, to, and opts attr readers" do opts = {:from => "foo", :to => "bar", :guard => "g"} st = Transitions::StateTransition.new(opts) assert_equal opts[:from], st.from assert_equal opts[:to], st.to assert_equal opts, st.options end test "should pass equality check if from and to are the same" do opts = {:from => "foo", :to => "bar", :guard => "g"} st = Transitions::StateTransition.new(opts) obj = stub obj.stubs(:from).returns(opts[:from]) obj.stubs(:to).returns(opts[:to]) assert_equal st, obj end test "should fail equality check if from are not the same" do opts = {:from => "foo", :to => "bar", :guard => "g"} st = Transitions::StateTransition.new(opts) obj = stub obj.stubs(:from).returns("blah") obj.stubs(:to).returns(opts[:to]) assert_not_equal st, obj end test "should fail equality check if to are not the same" do opts = {:from => "foo", :to => "bar", :guard => "g"} st = Transitions::StateTransition.new(opts) obj = stub obj.stubs(:from).returns(opts[:from]) obj.stubs(:to).returns("blah") assert_not_equal st, obj end end
Version data entries
25 entries across 25 versions & 1 rubygems