micro-max-box 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/aasm-6.0.0/CHANGELOG.md +497 -0
  3. data/aasm-6.0.0/LICENSE +20 -0
  4. data/aasm-6.0.0/README.md +1534 -0
  5. data/aasm-6.0.0/lib/aasm/aasm.rb +208 -0
  6. data/aasm-6.0.0/lib/aasm/base.rb +300 -0
  7. data/aasm-6.0.0/lib/aasm/configuration.rb +48 -0
  8. data/aasm-6.0.0/lib/aasm/core/event.rb +178 -0
  9. data/aasm-6.0.0/lib/aasm/core/invoker.rb +129 -0
  10. data/aasm-6.0.0/lib/aasm/core/invokers/base_invoker.rb +85 -0
  11. data/aasm-6.0.0/lib/aasm/core/invokers/class_invoker.rb +75 -0
  12. data/aasm-6.0.0/lib/aasm/core/invokers/literal_invoker.rb +90 -0
  13. data/aasm-6.0.0/lib/aasm/core/invokers/proc_invoker.rb +94 -0
  14. data/aasm-6.0.0/lib/aasm/core/state.rb +91 -0
  15. data/aasm-6.0.0/lib/aasm/core/transition.rb +83 -0
  16. data/aasm-6.0.0/lib/aasm/dsl_helper.rb +32 -0
  17. data/aasm-6.0.0/lib/aasm/errors.rb +22 -0
  18. data/aasm-6.0.0/lib/aasm/instance_base.rb +153 -0
  19. data/aasm-6.0.0/lib/aasm/localizer.rb +64 -0
  20. data/aasm-6.0.0/lib/aasm/minitest/allow_event.rb +13 -0
  21. data/aasm-6.0.0/lib/aasm/minitest/allow_transition_to.rb +13 -0
  22. data/aasm-6.0.0/lib/aasm/minitest/have_state.rb +13 -0
  23. data/aasm-6.0.0/lib/aasm/minitest/transition_from.rb +21 -0
  24. data/aasm-6.0.0/lib/aasm/minitest.rb +5 -0
  25. data/aasm-6.0.0/lib/aasm/minitest_spec.rb +15 -0
  26. data/aasm-6.0.0/lib/aasm/persistence/active_record_persistence.rb +174 -0
  27. data/aasm-6.0.0/lib/aasm/persistence/base.rb +89 -0
  28. data/aasm-6.0.0/lib/aasm/persistence/core_data_query_persistence.rb +94 -0
  29. data/aasm-6.0.0/lib/aasm/persistence/dynamoid_persistence.rb +92 -0
  30. data/aasm-6.0.0/lib/aasm/persistence/mongoid_persistence.rb +126 -0
  31. data/aasm-6.0.0/lib/aasm/persistence/no_brainer_persistence.rb +105 -0
  32. data/aasm-6.0.0/lib/aasm/persistence/orm.rb +154 -0
  33. data/aasm-6.0.0/lib/aasm/persistence/plain_persistence.rb +26 -0
  34. data/aasm-6.0.0/lib/aasm/persistence/redis_persistence.rb +112 -0
  35. data/aasm-6.0.0/lib/aasm/persistence/sequel_persistence.rb +83 -0
  36. data/aasm-6.0.0/lib/aasm/persistence.rb +54 -0
  37. data/aasm-6.0.0/lib/aasm/rspec/allow_event.rb +26 -0
  38. data/aasm-6.0.0/lib/aasm/rspec/allow_transition_to.rb +26 -0
  39. data/aasm-6.0.0/lib/aasm/rspec/have_state.rb +22 -0
  40. data/aasm-6.0.0/lib/aasm/rspec/transition_from.rb +36 -0
  41. data/aasm-6.0.0/lib/aasm/rspec.rb +5 -0
  42. data/aasm-6.0.0/lib/aasm/state_machine.rb +53 -0
  43. data/aasm-6.0.0/lib/aasm/state_machine_store.rb +77 -0
  44. data/aasm-6.0.0/lib/aasm/version.rb +3 -0
  45. data/aasm-6.0.0/lib/aasm.rb +21 -0
  46. data/aasm-6.0.0/lib/generators/aasm/aasm_generator.rb +16 -0
  47. data/aasm-6.0.0/lib/generators/aasm/orm_helpers.rb +41 -0
  48. data/aasm-6.0.0/lib/generators/active_record/aasm_generator.rb +40 -0
  49. data/aasm-6.0.0/lib/generators/active_record/templates/migration.rb +8 -0
  50. data/aasm-6.0.0/lib/generators/active_record/templates/migration_existing.rb +5 -0
  51. data/aasm-6.0.0/lib/generators/mongoid/aasm_generator.rb +28 -0
  52. data/aasm-6.0.0/lib/generators/nobrainer/aasm_generator.rb +28 -0
  53. data/aasm-6.0.0/lib/motion-aasm.rb +37 -0
  54. data/micro-max-box.gemspec +12 -0
  55. metadata +94 -0
@@ -0,0 +1,91 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AASM::Core
4
+ class State
5
+ attr_reader :name, :state_machine, :options, :default_display_name
6
+
7
+ def initialize(name, klass, state_machine, options={})
8
+ @name = name
9
+ @klass = klass
10
+ @state_machine = state_machine
11
+ @default_display_name = name.to_s.gsub(/_/, ' ').capitalize
12
+ update(options)
13
+ end
14
+
15
+ # called internally by Ruby 1.9 after clone()
16
+ def initialize_copy(orig)
17
+ super
18
+ @options = {}
19
+ orig.options.each_pair do |name, setting|
20
+ @options[name] = if setting.is_a?(Hash) || setting.is_a?(Array)
21
+ setting.dup
22
+ else
23
+ setting
24
+ end
25
+ end
26
+ end
27
+
28
+ def ==(state)
29
+ if state.is_a? Symbol
30
+ name == state
31
+ else
32
+ name == state.name
33
+ end
34
+ end
35
+
36
+ def <=>(state)
37
+ if state.is_a? Symbol
38
+ name <=> state
39
+ else
40
+ name <=> state.name
41
+ end
42
+ end
43
+
44
+ def to_s
45
+ name.to_s
46
+ end
47
+
48
+ def fire_callbacks(action, record, *args)
49
+ action = @options[action]
50
+ catch :halt_aasm_chain do
51
+ action.is_a?(Array) ?
52
+ action.each {|a| _fire_callbacks(a, record, args)} :
53
+ _fire_callbacks(action, record, args)
54
+ end
55
+ end
56
+
57
+ def display_name
58
+ @display_name = begin
59
+ if Module.const_defined?(:I18n)
60
+ localized_name
61
+ else
62
+ @default_display_name
63
+ end
64
+ end
65
+ end
66
+
67
+ def localized_name
68
+ AASM::Localizer.new.human_state_name(@klass, self)
69
+ end
70
+ alias human_name localized_name
71
+
72
+ def for_select
73
+ [display_name, name.to_s]
74
+ end
75
+
76
+ private
77
+
78
+ def update(options = {})
79
+ if options.key?(:display)
80
+ @default_display_name = options.delete(:display)
81
+ end
82
+ @options = options
83
+ self
84
+ end
85
+
86
+ def _fire_callbacks(action, record, args)
87
+ Invoker.new(action, record, args).invoke
88
+ end
89
+
90
+ end
91
+ end # AASM
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AASM::Core
4
+ class Transition
5
+ include AASM::DslHelper
6
+
7
+ attr_reader :from, :to, :event, :opts, :failures
8
+ alias_method :options, :opts
9
+
10
+ def initialize(event, opts, &block)
11
+ add_options_from_dsl(opts, [:on_transition, :guard, :after, :success], &block) if block
12
+
13
+ @event = event
14
+ @from = opts[:from]
15
+ @to = opts[:to]
16
+ @guards = Array(opts[:guards]) + Array(opts[:guard]) + Array(opts[:if])
17
+ @unless = Array(opts[:unless]) #TODO: This could use a better name
18
+ @failures = []
19
+
20
+ if opts[:on_transition]
21
+ warn '[DEPRECATION] :on_transition is deprecated, use :after instead'
22
+ opts[:after] = Array(opts[:after]) + Array(opts[:on_transition])
23
+ end
24
+ @after = Array(opts[:after])
25
+ @after = @after[0] if @after.size == 1
26
+
27
+ @success = Array(opts[:success])
28
+ @success = @success[0] if @success.size == 1
29
+
30
+ @opts = opts
31
+ end
32
+
33
+ # called internally by Ruby 1.9 after clone()
34
+ def initialize_copy(orig)
35
+ super
36
+ @guards = @guards.dup
37
+ @unless = @unless.dup
38
+ @opts = {}
39
+ orig.opts.each_pair { |name, setting| @opts[name] = setting.is_a?(Hash) || setting.is_a?(Array) ? setting.dup : setting }
40
+ end
41
+
42
+ def allowed?(obj, *args)
43
+ invoke_callbacks_compatible_with_guard(@guards, obj, args, :guard => true) &&
44
+ invoke_callbacks_compatible_with_guard(@unless, obj, args, :unless => true)
45
+ end
46
+
47
+ def execute(obj, *args)
48
+ invoke_callbacks_compatible_with_guard(event.state_machine.global_callbacks[:after_all_transitions], obj, args)
49
+ invoke_callbacks_compatible_with_guard(@after, obj, args)
50
+ end
51
+
52
+ def ==(obj)
53
+ @from == obj.from && @to == obj.to
54
+ end
55
+
56
+ def from?(value)
57
+ @from == value
58
+ end
59
+
60
+ def invoke_success_callbacks(obj, *args)
61
+ _fire_callbacks(@success, obj, args)
62
+ end
63
+
64
+ private
65
+
66
+ def invoke_callbacks_compatible_with_guard(code, record, args, options={})
67
+ if record.respond_to?(:aasm)
68
+ record.aasm(event.state_machine.name).from_state = @from if record.aasm(event.state_machine.name).respond_to?(:from_state=)
69
+ record.aasm(event.state_machine.name).to_state = @to if record.aasm(event.state_machine.name).respond_to?(:to_state=)
70
+ end
71
+
72
+ Invoker.new(code, record, args)
73
+ .with_options(options)
74
+ .with_failures(failures)
75
+ .invoke
76
+ end
77
+
78
+ def _fire_callbacks(code, record, args)
79
+ Invoker.new(code, record, args).invoke
80
+ end
81
+
82
+ end
83
+ end # AASM
@@ -0,0 +1,32 @@
1
+ module AASM
2
+ module DslHelper
3
+
4
+ class Proxy
5
+ attr_accessor :options
6
+
7
+ def initialize(options, valid_keys, source)
8
+ @valid_keys = valid_keys
9
+ @source = source
10
+
11
+ @options = options
12
+ end
13
+
14
+ def method_missing(name, *args, &block)
15
+ if @valid_keys.include?(name)
16
+ options[name] = Array(options[name])
17
+ options[name] << block if block
18
+ options[name] += Array(args)
19
+ else
20
+ @source.send name, *args, &block
21
+ end
22
+ end
23
+ end
24
+
25
+ def add_options_from_dsl(options, valid_keys, &block)
26
+ proxy = Proxy.new(options, valid_keys, self)
27
+ proxy.instance_eval(&block)
28
+ proxy.options
29
+ end
30
+
31
+ end
32
+ end
@@ -0,0 +1,22 @@
1
+ module AASM
2
+
3
+ class UnknownStateMachineError < RuntimeError; end
4
+
5
+ class InvalidTransition < RuntimeError
6
+ attr_reader :object, :event_name, :originating_state, :failures, :state_machine_name
7
+
8
+ def initialize(object, event_name, state_machine_name, failures = [])
9
+ @object, @event_name, @originating_state, @failures = object, event_name, object.aasm(state_machine_name).current_state, failures
10
+ @state_machine_name = state_machine_name
11
+ super("Event '#{event_name}' cannot transition from '#{originating_state}'.#{reasoning}")
12
+ end
13
+
14
+ def reasoning
15
+ " Failed callback(s): #{failures}." unless failures.empty?
16
+ end
17
+ end
18
+
19
+ class UndefinedState < RuntimeError; end
20
+ class UndefinedEvent < UndefinedState; end
21
+ class NoDirectAssignmentError < RuntimeError; end
22
+ end
@@ -0,0 +1,153 @@
1
+ module AASM
2
+ class InstanceBase
3
+ attr_accessor :from_state, :to_state, :current_event
4
+
5
+ def initialize(instance, name=:default) # instance of the class including AASM, name of the state machine
6
+ @instance = instance
7
+ @name = name
8
+ end
9
+
10
+ def current_state
11
+ @instance.aasm_read_state(@name)
12
+ end
13
+
14
+ def current_state=(state)
15
+ @instance.aasm_write_state_without_persistence(state, @name)
16
+ end
17
+
18
+ def enter_initial_state
19
+ state_name = determine_state_name(@instance.class.aasm(@name).initial_state)
20
+ state_object = state_object_for_name(state_name)
21
+
22
+ state_object.fire_callbacks(:before_enter, @instance)
23
+ self.current_state = state_name
24
+ state_object.fire_callbacks(:after_enter, @instance)
25
+
26
+ state_name
27
+ end
28
+
29
+ def human_state
30
+ state_object_for_name(current_state).display_name
31
+ end
32
+
33
+ def states(options={}, *args)
34
+ if options.has_key?(:permitted)
35
+ selected_events = events({:permitted => options[:permitted]}, *args)
36
+ # An array of arrays. Each inner array represents the transitions that
37
+ # transition from the current state for an event
38
+ event_transitions = selected_events.map {|e| e.transitions_from_state(current_state) }
39
+
40
+ # An array of :to transition states
41
+ to_state_names = event_transitions.map do |transitions|
42
+ return nil if transitions.empty?
43
+
44
+ # Return the :to state of the first transition that is allowed (or not) or nil
45
+ if options[:permitted]
46
+ transition = transitions.find { |t| t.allowed?(@instance, *args) }
47
+ else
48
+ transition = transitions.find { |t| !t.allowed?(@instance, *args) }
49
+ end
50
+ transition ? transition.to : nil
51
+ end.flatten.compact.uniq
52
+
53
+ # Select states that are in to_state_names
54
+ @instance.class.aasm(@name).states.select {|s| to_state_names.include?(s.name)}
55
+ else
56
+ @instance.class.aasm(@name).states
57
+ end
58
+ end
59
+
60
+ def events(options={}, *args)
61
+ state = options[:state] || current_state
62
+ events = @instance.class.aasm(@name).events.select {|e| e.transitions_from_state?(state) }
63
+
64
+ options[:reject] = Array(options[:reject])
65
+ events.reject! { |e| options[:reject].include?(e.name) }
66
+
67
+ if options.has_key?(:permitted)
68
+ # filters the results of events_for_current_state so that only those that
69
+ # are really currently possible (given transition guards) are shown.
70
+ if options[:permitted]
71
+ events.select! { |e| @instance.send("may_#{event_method_name(e.name)}?", *args) }
72
+ else
73
+ events.select! { |e| !@instance.send("may_#{event_method_name(e.name)}?", *args) }
74
+ end
75
+ end
76
+
77
+ events
78
+ end
79
+
80
+ def permitted_transitions
81
+ events(permitted: true).flat_map do |event|
82
+ available_transitions = event.transitions_from_state(current_state)
83
+ allowed_transitions = available_transitions.select { |t| t.allowed?(@instance) }
84
+
85
+ allowed_transitions.map do |transition|
86
+ { event: event.name, state: transition.to }
87
+ end
88
+ end
89
+ end
90
+
91
+ def state_object_for_name(name)
92
+ obj = @instance.class.aasm(@name).states.find {|s| s.name == name}
93
+ raise AASM::UndefinedState, "State :#{name} doesn't exist" if obj.nil?
94
+ obj
95
+ end
96
+
97
+ def determine_state_name(state)
98
+ case state
99
+ when Symbol, String
100
+ state
101
+ when Proc
102
+ state.call(@instance)
103
+ else
104
+ raise NotImplementedError, "Unrecognized state-type given. Expected Symbol, String, or Proc."
105
+ end
106
+ end
107
+
108
+ def may_fire_event?(name, *args)
109
+ if event = @instance.class.aasm(@name).state_machine.events[name]
110
+ !!event.may_fire?(@instance, *args)
111
+ else
112
+ false # unknown event
113
+ end
114
+ end
115
+
116
+ def fire(event_name, *args, &block)
117
+ event_exists?(event_name)
118
+ @instance.send(event_method_name(event_name), *args, &block)
119
+ end
120
+
121
+ def fire!(event_name, *args, &block)
122
+ event_exists?(event_name, true)
123
+ bang_event_name = "#{event_method_name(event_name)}!".to_sym
124
+ @instance.send(bang_event_name, *args, &block)
125
+ end
126
+
127
+ def set_current_state_with_persistence(state)
128
+ save_success = @instance.aasm_write_state(state, @name)
129
+ self.current_state = state if save_success
130
+ save_success
131
+ end
132
+
133
+ private
134
+
135
+ def event_method_name(event_name)
136
+ config = @instance.class.aasm(@name).state_machine.config
137
+ if config.namespace
138
+ ns = (config.namespace == true) ? @name : config.namespace
139
+ "#{event_name}_#{ns}"
140
+ else
141
+ event_name.to_s
142
+ end
143
+ end
144
+
145
+ def event_exists?(event_name, bang = false)
146
+ event = @instance.class.aasm(@name).state_machine.events[event_name.to_sym]
147
+ return true if event
148
+
149
+ event_error = bang ? "#{event_name}!" : event_name
150
+ raise AASM::UndefinedEvent, "Event :#{event_error} doesn't exist" if event.nil?
151
+ end
152
+ end
153
+ end
@@ -0,0 +1,64 @@
1
+ module AASM
2
+ class Localizer
3
+ def human_event_name(klass, event)
4
+ checklist = ancestors_list(klass).inject([]) do |list, ancestor|
5
+ list << :"#{i18n_scope(klass)}.events.#{i18n_klass(ancestor)}.#{event}"
6
+ list
7
+ end
8
+ translate_queue(checklist) || I18n.translate(checklist.shift, :default => default_display_name(event))
9
+ end
10
+
11
+ def human_state_name(klass, state)
12
+ checklist = ancestors_list(klass).inject([]) do |list, ancestor|
13
+ list << item_for(klass, state, ancestor)
14
+ list << item_for(klass, state, ancestor, :old_style => true)
15
+ list
16
+ end
17
+ translate_queue(checklist) || I18n.translate(checklist.shift, :default => default_display_name(state))
18
+ end
19
+
20
+ private
21
+
22
+ def item_for(klass, state, ancestor, options={})
23
+ separator = options[:old_style] ? '.' : '/'
24
+ :"#{i18n_scope(klass)}.attributes.#{i18n_klass(ancestor)}.#{klass.aasm(state.state_machine.name).attribute_name}#{separator}#{state}"
25
+ end
26
+
27
+ def translate_queue(checklist)
28
+ (0...(checklist.size-1)).each do |i|
29
+ begin
30
+ return I18n.translate(checklist.shift, :raise => true)
31
+ rescue I18n::MissingTranslationData
32
+ # that's okay
33
+ end
34
+ end
35
+ nil
36
+ end
37
+
38
+ # added for rails 2.x compatibility
39
+ def i18n_scope(klass)
40
+ klass.respond_to?(:i18n_scope) ? klass.i18n_scope : :activerecord
41
+ end
42
+
43
+ # added for rails < 3.0.3 compatibility
44
+ def i18n_klass(klass)
45
+ klass.model_name.respond_to?(:i18n_key) ? klass.model_name.i18n_key : klass.name.underscore
46
+ end
47
+
48
+ def ancestors_list(klass)
49
+ has_active_record_base = defined?(::ActiveRecord::Base)
50
+ klass.ancestors.select do |ancestor|
51
+ not_active_record_base = has_active_record_base ? (ancestor != ::ActiveRecord::Base) : true
52
+ ancestor.respond_to?(:model_name) && not_active_record_base
53
+ end
54
+ end
55
+
56
+ def default_display_name(object) # Can use better argument name
57
+ if object.respond_to?(:default_display_name)
58
+ object.default_display_name
59
+ else
60
+ object.to_s.gsub(/_/, ' ').capitalize
61
+ end
62
+ end
63
+ end
64
+ end # AASM
@@ -0,0 +1,13 @@
1
+ module Minitest::Assertions
2
+ def assert_event_allowed(object, event, options = {})
3
+ state_machine_name = options.fetch(:on, :default)
4
+ assert object.aasm(state_machine_name).may_fire_event?(event),
5
+ "Expected that the event :#{event} would be allowed (on :#{state_machine_name})"
6
+ end
7
+
8
+ def refute_event_allowed(object, event, options = {})
9
+ state_machine_name = options.fetch(:on, :default)
10
+ refute object.aasm(state_machine_name).may_fire_event?(event),
11
+ "Expected that the event :#{event} would not be allowed (on :#{state_machine_name})"
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module Minitest::Assertions
2
+ def assert_transition_to_allowed(object, to_state, options = {})
3
+ state_machine_name = options.fetch(:on, :default)
4
+ assert object.aasm(state_machine_name).states(permitted: true).include?(to_state),
5
+ "Expected that the state :#{to_state} would be reachable (on :#{state_machine_name})"
6
+ end
7
+
8
+ def refute_transition_to_allowed(object, to_state, options = {})
9
+ state_machine_name = options.fetch(:on, :default)
10
+ refute object.aasm(state_machine_name).states(permitted: true).include?(to_state),
11
+ "Expected that the state :#{to_state} would be reachable (on :#{state_machine_name})"
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module Minitest::Assertions
2
+ def assert_have_state(object, state, options = {})
3
+ state_machine_name = options.fetch(:on, :default)
4
+ assert object.aasm(state_machine_name).current_state == state,
5
+ "Expected that :#{object.aasm(state_machine_name).current_state} would be :#{state} (on :#{state_machine_name})"
6
+ end
7
+
8
+ def refute_have_state(object, state, options = {})
9
+ state_machine_name = options.fetch(:on, :default)
10
+ refute object.aasm(state_machine_name).current_state == state,
11
+ "Expected that :#{object.aasm(state_machine_name).current_state} would be :#{state} (on :#{state_machine_name})"
12
+ end
13
+ end
@@ -0,0 +1,21 @@
1
+ module Minitest::Assertions
2
+ def assert_transitions_from(object, from_state, *args)
3
+ options = args.first
4
+ options[:on] ||= :default
5
+ assert _transitions_from?(object, from_state, args, options),
6
+ "Expected transition state to :#{options[:to]} from :#{from_state} on event :#{options[:on_event]}, (on :#{options[:on]})"
7
+ end
8
+
9
+ def refute_transitions_from(object, from_state, *args)
10
+ options = args.first
11
+ options[:on] ||= :default
12
+ refute _transitions_from?(object, from_state, args, options),
13
+ "Expected transition state to :#{options[:to]} from :#{from_state} on event :#{options[:on_event]}, (on :#{options[:on]})"
14
+ end
15
+
16
+ def _transitions_from?(object, from_state, args, options)
17
+ state_machine_name = options[:on]
18
+ object.aasm(state_machine_name).current_state = from_state.to_sym
19
+ object.send(options[:on_event], *args) && options[:to].to_sym == object.aasm(state_machine_name).current_state
20
+ end
21
+ end
@@ -0,0 +1,5 @@
1
+ Minitest = MiniTest unless defined? Minitest
2
+ # relative-require all minitest_spec files
3
+ Dir[File.dirname(__FILE__) + '/minitest/*.rb'].each do |file|
4
+ require 'aasm/minitest/' + File.basename(file, File.extname(file))
5
+ end
@@ -0,0 +1,15 @@
1
+ require 'aasm/minitest'
2
+
3
+ module Minitest::Expectations
4
+ AASM.infect_an_assertion :assert_transitions_from, :must_transition_from, :do_not_flip
5
+ AASM.infect_an_assertion :refute_transitions_from, :wont_transition_from, :do_not_flip
6
+
7
+ AASM.infect_an_assertion :assert_transition_to_allowed, :must_allow_transition_to, :do_not_flip
8
+ AASM.infect_an_assertion :refute_transition_to_allowed, :wont_allow_transition_to, :do_not_flip
9
+
10
+ AASM.infect_an_assertion :assert_have_state, :must_have_state, :do_not_flip
11
+ AASM.infect_an_assertion :refute_have_state, :wont_have_state, :do_not_flip
12
+
13
+ AASM.infect_an_assertion :assert_event_allowed, :must_allow_event, :do_not_flip
14
+ AASM.infect_an_assertion :refute_event_allowed, :wont_allow_event, :do_not_flip
15
+ end