Remove extract_options!, active_support dependency from minitest assertions

This commit is contained in:
Anil Maurya 2017-04-03 13:45:22 +05:30
parent b9c9a4e738
commit e03f8d9afe
1 changed files with 3 additions and 3 deletions

View File

@ -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