mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
Remove extract_options!, active_support dependency from minitest assertions
This commit is contained in:
parent
b9c9a4e738
commit
e03f8d9afe
1 changed files with 3 additions and 3 deletions
|
@ -1,13 +1,13 @@
|
|||
module Minitest::Assertions
|
||||
def assert_transitions_from(object, from_state, *args)
|
||||
options = args.extract_options!
|
||||
options = args.first
|
||||
options[:on] ||= :default
|
||||
assert _transitions_from?(object, from_state, args, options),
|
||||
"Expected transition state to :#{options[:to]} from :#{from_state} on event :#{options[:on_event]}, (on :#{options[:on]})"
|
||||
end
|
||||
|
||||
def refute_transitions_from(object, from_state, *args)
|
||||
options = args.extract_options!
|
||||
options = args.first
|
||||
options[:on] ||= :default
|
||||
refute _transitions_from?(object, from_state, args, options),
|
||||
"Expected transition state to :#{options[:to]} from :#{from_state} on event :#{options[:on_event]}, (on :#{options[:on]})"
|
||||
|
@ -18,4 +18,4 @@ module Minitest::Assertions
|
|||
object.aasm(state_machine_name).current_state = from_state.to_sym
|
||||
object.send(options[:on_event], *args) && options[:to].to_sym == object.aasm(state_machine_name).current_state
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue