hero 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -8
- data/Gemfile.lock +15 -20
- data/README.md +3 -0
- data/Rakefile +11 -0
- data/lib/hero/version.rb +1 -1
- data/test/formula_test.rb +9 -9
- data/test/test_helper.rb +2 -2
- metadata +58 -10
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,33 +1,28 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
hero (0.1.8)
|
5
|
+
|
1
6
|
GEM
|
2
|
-
remote:
|
7
|
+
remote: https://rubygems.org/
|
3
8
|
specs:
|
4
|
-
|
5
|
-
facter (>= 1.6.12)
|
6
|
-
timers (>= 1.0.0)
|
7
|
-
coderay (1.0.8)
|
8
|
-
facter (1.6.14)
|
9
|
+
coderay (1.0.9)
|
9
10
|
method_source (0.8.1)
|
10
|
-
micro_mock (
|
11
|
-
micro_test (0.3.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
method_source (~> 0.8)
|
16
|
-
slop (~> 3.3.1)
|
17
|
-
pry (0.9.10-java)
|
11
|
+
micro_mock (1.1.0)
|
12
|
+
micro_test (0.3.5)
|
13
|
+
os
|
14
|
+
os (0.9.6)
|
15
|
+
pry (0.9.12)
|
18
16
|
coderay (~> 1.0.5)
|
19
17
|
method_source (~> 0.8)
|
20
|
-
slop (~> 3.
|
21
|
-
|
22
|
-
slop (3.3.3)
|
23
|
-
spoon (0.0.1)
|
24
|
-
timers (1.0.1)
|
18
|
+
slop (~> 3.4)
|
19
|
+
slop (3.4.4)
|
25
20
|
|
26
21
|
PLATFORMS
|
27
|
-
java
|
28
22
|
ruby
|
29
23
|
|
30
24
|
DEPENDENCIES
|
25
|
+
hero!
|
31
26
|
micro_mock
|
32
27
|
micro_test
|
33
28
|
pry
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Hero
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/hopsoft/hero.png)](https://travis-ci.org/hopsoft/hero)
|
4
|
+
[![Dependency Status](https://gemnasium.com/hopsoft/hero.png)](https://gemnasium.com/hopsoft/hero)
|
5
|
+
|
3
6
|
![Hero GEM](http://hopsoft.github.com/hero/images/hero.jpg)
|
4
7
|
|
5
8
|
## Its a bird, its a plane, its... its... my Hero
|
data/Rakefile
ADDED
data/lib/hero/version.rb
CHANGED
data/test/formula_test.rb
CHANGED
@@ -44,7 +44,7 @@ class FormulaTest < MicroTest::Test
|
|
44
44
|
|
45
45
|
test "should allow unnamed Class steps" do
|
46
46
|
step = MicroMock.make
|
47
|
-
step.
|
47
|
+
step.def(:call) {}
|
48
48
|
Hero::Formula[@formula_name].add_step step
|
49
49
|
assert Hero::Formula[@formula_name].steps.map{|s| s.first}.first =~ /MicroMock/
|
50
50
|
assert Hero::Formula[@formula_name].steps.map{|s| s.last}.include?(step)
|
@@ -52,7 +52,7 @@ class FormulaTest < MicroTest::Test
|
|
52
52
|
|
53
53
|
test "should allow named Class steps" do
|
54
54
|
step = MicroMock.make
|
55
|
-
step.
|
55
|
+
step.def(:call) {}
|
56
56
|
Hero::Formula[@formula_name].add_step :foo, step
|
57
57
|
assert Hero::Formula[@formula_name].steps.map{|s| s.first}.include?(:foo)
|
58
58
|
assert Hero::Formula[@formula_name].steps.map{|s| s.last}.include?(step)
|
@@ -60,7 +60,7 @@ class FormulaTest < MicroTest::Test
|
|
60
60
|
|
61
61
|
test "should allow unnamed instance steps" do
|
62
62
|
step = MicroMock.make.new
|
63
|
-
step.
|
63
|
+
step.def(:call) {}
|
64
64
|
Hero::Formula[@formula_name].add_step step
|
65
65
|
names = Hero::Formula[@formula_name].steps.map{|s| s.first}
|
66
66
|
steps = Hero::Formula[@formula_name].steps.map{|s| s.last}
|
@@ -71,7 +71,7 @@ class FormulaTest < MicroTest::Test
|
|
71
71
|
|
72
72
|
test "should allow named instance steps" do
|
73
73
|
step = MicroMock.make.new
|
74
|
-
step.
|
74
|
+
step.def(:call) {}
|
75
75
|
Hero::Formula[@formula_name].add_step :foo, step
|
76
76
|
names = Hero::Formula[@formula_name].steps.map{|s| s.first}
|
77
77
|
steps = Hero::Formula[@formula_name].steps.map{|s| s.last}
|
@@ -167,7 +167,7 @@ class FormulaTest < MicroTest::Test
|
|
167
167
|
|
168
168
|
test "should support running step defined in a class" do
|
169
169
|
step = MicroMock.make.new
|
170
|
-
step.
|
170
|
+
step.def(:call) do |context, options|
|
171
171
|
options[:context] = context
|
172
172
|
end
|
173
173
|
|
@@ -209,8 +209,8 @@ class FormulaTest < MicroTest::Test
|
|
209
209
|
logger = MicroMock.make.new
|
210
210
|
logger.attr :buffer
|
211
211
|
logger.buffer = []
|
212
|
-
logger.
|
213
|
-
logger.
|
212
|
+
logger.def(:info) { |value| buffer << value }
|
213
|
+
logger.def(:error) { |value| buffer << value }
|
214
214
|
Hero.logger = logger
|
215
215
|
|
216
216
|
Hero::Formula[@formula_name].add_step(:one) { |list, opts| list << 1; opts[:step] = 1 }
|
@@ -231,8 +231,8 @@ class FormulaTest < MicroTest::Test
|
|
231
231
|
# logger.attr :buffer
|
232
232
|
# logger.attr(:info_count)
|
233
233
|
# logger.attr(:error_count)
|
234
|
-
# logger.
|
235
|
-
# logger.
|
234
|
+
# logger.def(:info) { |value| buffer << value; self.info_count += 1 }
|
235
|
+
# logger.def(:error) { |value| buffer << value; self.error_count += 1 }
|
236
236
|
# logger.buffer = []
|
237
237
|
# logger.info_count = 0
|
238
238
|
# logger.error_count = 0
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,57 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
date: 2013-04-18 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: micro_test
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: micro_mock
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: pry
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: Think of Hero as a simplified state machine.
|
18
63
|
email:
|
19
64
|
- natehop@gmail.com
|
20
65
|
executables: []
|
@@ -28,6 +73,7 @@ files:
|
|
28
73
|
- Gemfile
|
29
74
|
- Gemfile.lock
|
30
75
|
- LICENSE.txt
|
76
|
+
- Rakefile
|
31
77
|
- README.md
|
32
78
|
- test/formula_test.rb
|
33
79
|
- test/observer_test.rb
|
@@ -53,9 +99,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
99
|
version: '0'
|
54
100
|
requirements: []
|
55
101
|
rubyforge_project:
|
56
|
-
rubygems_version: 1.8.
|
102
|
+
rubygems_version: 1.8.25
|
57
103
|
signing_key:
|
58
104
|
specification_version: 3
|
59
105
|
summary: Think of Hero as a simplified state machine.
|
60
|
-
test_files:
|
61
|
-
|
106
|
+
test_files:
|
107
|
+
- test/formula_test.rb
|
108
|
+
- test/observer_test.rb
|
109
|
+
- test/test_helper.rb
|