state_shifter 0.7.0 → 0.7.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.0
1
+ 0.7.1
@@ -6,10 +6,7 @@ module StateShifter
6
6
 
7
7
  def state_machine &definition
8
8
  @state_machine_definition = Contents.new(&definition)
9
- add_methods
10
- end
11
-
12
- def add_methods
9
+
13
10
  @state_machine_definition.states.each do |state_name, state_definition|
14
11
 
15
12
  module_eval do
@@ -20,9 +20,11 @@ shared_examples_for 'a simple state machine' do
20
20
 
21
21
  @state_machine.submit
22
22
  @state_machine.initial_state.should == :new
23
+ @state_machine.current_state.should == :awaiting_review
23
24
  end
24
25
 
25
26
  it 'should transit between states properly' do
27
+ @state_machine.current_state.should == :new
26
28
  @state_machine.submit
27
29
  @state_machine.current_state.should == :awaiting_review
28
30
 
@@ -43,6 +45,7 @@ shared_examples_for 'a simple state machine' do
43
45
  end
44
46
 
45
47
  it 'should respect guard statements' do
48
+ @state_machine.current_state.should == :new
46
49
  @state_machine.submit
47
50
  @state_machine.review
48
51
 
@@ -54,6 +57,7 @@ shared_examples_for 'a simple state machine' do
54
57
  end
55
58
 
56
59
  it 'should know if a transition is possible' do
60
+ @state_machine.current_state.should == :new
57
61
  @state_machine.can_submit?.should be_true
58
62
 
59
63
  @state_machine.submit
@@ -67,6 +71,7 @@ shared_examples_for 'a simple state machine' do
67
71
  end
68
72
 
69
73
  it 'should properly indicate next states' do
74
+ @state_machine.current_state.should == :new
70
75
  @state_machine.next_states.should == [:awaiting_review]
71
76
  @state_machine.transitionable_states.should == [:awaiting_review]
72
77
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "state_shifter"
8
- s.version = "0.7.0"
8
+ s.version = "0.7.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bruno Antunes"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_shifter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -172,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  segments:
174
174
  - 0
175
- hash: 4081808216781371275
175
+ hash: -1507395421623075771
176
176
  required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  none: false
178
178
  requirements: