screenplay 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/lib/screenplay.rb +12 -9
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a95ba6ead19e8a30a517ff94ea7616598bf5bb65
|
|
4
|
+
data.tar.gz: acda5c62d8456b8f9bff4b925b36965cc82ef6e0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e7cc1dc7b6b9348a38a98c5bc7c5fcd9556266a909febb3faf915e7b29b04ec37a693a3abbe4bac17a74982e99f0b11f995ed55ef48186ef2a4f46ea121eedea
|
|
7
|
+
data.tar.gz: 495367c4a4da1847bcd59c7197f318f811595be3b12d4aead02ec955b813ded14dd35e63aa843149e67dcf030375e99ff32342a1ce16ac58a69b2a14b385acf4
|
data/lib/screenplay.rb
CHANGED
|
@@ -11,6 +11,8 @@ require 'screenplay/scenarios'
|
|
|
11
11
|
module Screenplay
|
|
12
12
|
extend self
|
|
13
13
|
|
|
14
|
+
attr_reader :options
|
|
15
|
+
|
|
14
16
|
def prepare
|
|
15
17
|
Configuration.load
|
|
16
18
|
Cast.autoload
|
|
@@ -18,8 +20,10 @@ module Screenplay
|
|
|
18
20
|
end
|
|
19
21
|
|
|
20
22
|
def play(options = {})
|
|
21
|
-
options
|
|
22
|
-
options[:
|
|
23
|
+
@options = options
|
|
24
|
+
@options[:quiet] ||= false
|
|
25
|
+
@options[:human_friendly] ||= false
|
|
26
|
+
@options[:show_output] = @options[:show_output] && !@options[:quiet]
|
|
23
27
|
|
|
24
28
|
raise 'ERROR: Couldn\'t find any scenarios to play.' if Scenarios.size == 0
|
|
25
29
|
|
|
@@ -29,7 +33,7 @@ module Screenplay
|
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
each_scene { | scenario, actor_name, params, input, index |
|
|
32
|
-
puts "##### #{scenario.name} - #{actor_name}: #####" if
|
|
36
|
+
puts "##### #{scenario.name} - #{actor_name}: #####" if !@options[:quiet] && @options[:show_output]
|
|
33
37
|
params ||= {}
|
|
34
38
|
begin
|
|
35
39
|
output = Cast.get(actor_name).play(params, input)
|
|
@@ -37,18 +41,17 @@ module Screenplay
|
|
|
37
41
|
raise ScenarioFailedException.new(scenario, index, actor_name, e)
|
|
38
42
|
end
|
|
39
43
|
output.symbolize_keys!
|
|
40
|
-
unless (options[:quiet])
|
|
41
|
-
if (options[:show_output])
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
puts ''
|
|
44
|
+
unless (@options[:quiet])
|
|
45
|
+
if (@options[:show_output])
|
|
46
|
+
puts "output = " + @options[:human_friendly] ? JSON.pretty_generate(output) : output.to_s
|
|
47
|
+
puts ''
|
|
45
48
|
else
|
|
46
49
|
STDOUT << '.'
|
|
47
50
|
end
|
|
48
51
|
end
|
|
49
52
|
output
|
|
50
53
|
}
|
|
51
|
-
puts '' unless
|
|
54
|
+
puts '' unless @options[:quiet]
|
|
52
55
|
end
|
|
53
56
|
|
|
54
57
|
def each_scene
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: screenplay
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Taco Jan Osinga
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rest-client
|