seam 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/seam/step.rb +13 -1
- data/lib/seam/version.rb +1 -1
- data/spec/seam/step_spec.rb +30 -0
- metadata +5 -3
data/lib/seam/step.rb
CHANGED
@@ -12,8 +12,20 @@ module Seam
|
|
12
12
|
{
|
13
13
|
name: name,
|
14
14
|
type: type,
|
15
|
-
arguments:
|
15
|
+
arguments: get_arguments
|
16
16
|
}
|
17
17
|
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def get_arguments
|
22
|
+
arguments.map do |x|
|
23
|
+
if x.is_a? Hash
|
24
|
+
HashWithIndifferentAccess.new(x)
|
25
|
+
else
|
26
|
+
x
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
18
30
|
end
|
19
31
|
end
|
data/lib/seam/version.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe Seam::Step do
|
4
|
+
describe "initialize" do
|
5
|
+
it "should allow values to be set with the constructor" do
|
6
|
+
step = Seam::Step.new( { name: 'a name',
|
7
|
+
type: 'a type',
|
8
|
+
arguments: ['1234', 2] } )
|
9
|
+
step.name.must_equal 'a name'
|
10
|
+
step.type.must_equal 'a type'
|
11
|
+
step.arguments.count.must_equal 2
|
12
|
+
step.arguments[0].must_equal '1234'
|
13
|
+
step.arguments[1].must_equal 2
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "to hash" do
|
18
|
+
it "should allow values to be set with the constructor" do
|
19
|
+
step = Seam::Step.new( { name: 'a name',
|
20
|
+
type: 'a type',
|
21
|
+
arguments: ['1234', 2] } )
|
22
|
+
step = Seam::Step.new step.to_hash
|
23
|
+
step.name.must_equal 'a name'
|
24
|
+
step.type.must_equal 'a type'
|
25
|
+
step.arguments.count.must_equal 2
|
26
|
+
step.arguments[0].must_equal '1234'
|
27
|
+
step.arguments[1].must_equal 2
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -210,6 +210,7 @@ files:
|
|
210
210
|
- seam.gemspec
|
211
211
|
- spec/seam/effort_spec.rb
|
212
212
|
- spec/seam/flow_spec.rb
|
213
|
+
- spec/seam/step_spec.rb
|
213
214
|
- spec/seam/worker_spec.rb
|
214
215
|
- spec/spec_helper.rb
|
215
216
|
homepage: ''
|
@@ -227,7 +228,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
227
228
|
version: '0'
|
228
229
|
segments:
|
229
230
|
- 0
|
230
|
-
hash:
|
231
|
+
hash: 4001325286817119125
|
231
232
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
232
233
|
none: false
|
233
234
|
requirements:
|
@@ -236,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
236
237
|
version: '0'
|
237
238
|
segments:
|
238
239
|
- 0
|
239
|
-
hash:
|
240
|
+
hash: 4001325286817119125
|
240
241
|
requirements: []
|
241
242
|
rubyforge_project:
|
242
243
|
rubygems_version: 1.8.25
|
@@ -246,5 +247,6 @@ summary: Simple workflows
|
|
246
247
|
test_files:
|
247
248
|
- spec/seam/effort_spec.rb
|
248
249
|
- spec/seam/flow_spec.rb
|
250
|
+
- spec/seam/step_spec.rb
|
249
251
|
- spec/seam/worker_spec.rb
|
250
252
|
- spec/spec_helper.rb
|