test/event/test_event_checks.rb in transitions-0.2.0 vs test/event/test_event_checks.rb in transitions-0.2.1
- old
+ new
@@ -1,27 +1,27 @@
-require "helper"
+require 'helper'
class ChecksTestSubject
include Transitions
- state_machine :initial => :initial do
+ state_machine initial: :initial do
state :initial
state :opened
state :closed
event :open do
- transitions :from => :initial, :to => :opened
+ transitions from: :initial, to: :opened
end
event :close do
- transitions :from => :opened, :to => :closed
+ transitions from: :opened, to: :closed
end
end
end
class StateMachineChecksTest < Test::Unit::TestCase
- test "checks if a given transition is possible" do
+ test 'checks if a given transition is possible' do
subject = ChecksTestSubject.new
assert_equal :initial, subject.current_state
assert_equal true, subject.can_open?
assert_equal false, subject.can_close?
@@ -29,6 +29,5 @@
assert_equal false, subject.can_open?
assert_equal true, subject.can_close?
end
end
-