henry-container 0.0.44 → 0.0.45

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,7 +1,8 @@
1
- Gemfile.lock
2
- vendor
3
- bundle
4
- .bundle
5
- *.gem
6
- doc/
1
+ Gemfile.lock
2
+ vendor
3
+ bundle
4
+ .bundle
5
+ *.gem
6
+ doc/
7
7
  .yardoc
8
+ .DS_Store
@@ -3,7 +3,7 @@ module Henry
3
3
  class Container
4
4
 
5
5
  # Current Gem version
6
- VERSION = '0.0.44'
6
+ VERSION = '0.0.45'
7
7
 
8
8
  end
9
9
 
@@ -8,20 +8,24 @@ module Henry
8
8
  # The Henry Task implementation for Cucumber
9
9
  class CucumberTask < Task
10
10
 
11
+ # The temporary output file path for the RspecTask execution.
12
+ OUT_PATH = 'cucumber.out'
13
+
14
+ # The reports path template.
15
+ REPORTS_DIR = '.henry/reports/${FORMAT}'
16
+
11
17
  # Executes the CucumberTask and returns its results.
12
- #
13
- # @return [Hash] the CucumberTask results.
14
18
  def execute
15
19
  begin
16
20
  Rake.application['cucumber'].invoke
17
21
 
18
22
  self.execution.code = 'OK'
19
23
  self.execution.message = 'OK'
20
- self.execution.output = File.open('cucumber.out', 'r').read
24
+ self.execution.output = File.open(OUT_PATH, 'r').read
21
25
  rescue Exception => e
22
26
  self.execution.code = 'ERROR'
23
27
  self.execution.message = 'ERROR'
24
- self.execution.output = File.open('cucumber.out', 'r').read
28
+ self.execution.output = File.open(OUT_PATH, 'r').read
25
29
  self.execution.backtrace = e.message
26
30
  end
27
31
  end
@@ -30,16 +34,45 @@ module Henry
30
34
  #
31
35
  # @param [Hash] params the task params.
32
36
  def configure(params)
33
- File.open('cucumber.out', 'w') { |f| }
37
+ File.open(OUT_PATH, 'w') { |f| }
34
38
 
35
39
  # Makes available the cucumber rake task.
36
40
  Cucumber::Rake::Task.new do |t|
37
- t.cucumber_opts = %w{--out cucumber.out}
38
- t.fork = false
41
+ if self.data.options
42
+ t.rspec_opts = self.custom_option
43
+ else
44
+ t.cucumber_opts = "--out #{OUT_PATH}"
45
+ t.fork = false
46
+ end
39
47
  end
40
48
 
41
49
  self.export_params(params)
42
50
  end
51
+
52
+ # Returns the custom cucumber_opts that user may have passed.
53
+ #
54
+ # @return [String]
55
+ def custom_options
56
+ "#{self.format_options} #{self.tags_options}"
57
+ end
58
+
59
+ # Returns the cucumber_opts related with formatting.
60
+ #
61
+ # @return [String]
62
+ def format_options
63
+ "--out #{OUT_PATH}"
64
+ end
65
+
66
+ # Returns the cucumber_opts related with tags to be run.
67
+ #
68
+ # @return [String]
69
+ def tags_options
70
+ return '' if self.data.options['tags'].nil?
71
+
72
+ self.data.options['tags'].collect do |tag|
73
+ "--tags #{tag}"
74
+ end.join(' ')
75
+ end
43
76
 
44
77
  end
45
78
 
@@ -34,7 +34,7 @@ module Henry
34
34
  #
35
35
  # @param [Hash] params the task params.
36
36
  def configure(params)
37
- File.open('rspec.out', 'w') { |f| }
37
+ File.open(OUT_PATH, 'w') { |f| }
38
38
 
39
39
  # Makes available the spec rake task.
40
40
  RSpec::Core::RakeTask.new do |t|
@@ -43,7 +43,7 @@ module Henry
43
43
  t.rspec_opts = self.custom_options
44
44
  else
45
45
  t.pattern = 'spec/*'
46
- t.rspec_opts = "--out #{OUT_PATH}"
46
+ t.rspec_opts = self.default_options
47
47
  end
48
48
  end
49
49
 
@@ -59,13 +59,20 @@ module Henry
59
59
  "#{self.format_options} #{self.report_options}"
60
60
  end
61
61
 
62
+ # Returns the default rspec_opts.
63
+ #
64
+ # @return [String]
65
+ def default_options
66
+ "--format documentation --out #{OUT_PATH}"
67
+ end
68
+
62
69
  # Returns the rspec_opts related with formatting.
63
70
  #
64
71
  # @return [String]
65
72
  def format_options
66
73
  "--format #{self.data.options['format'] || 'documentation'} --out #{OUT_PATH}"
67
74
  end
68
-
75
+
69
76
  # Returns the rspec_opts related with report paaths and formats.
70
77
  #
71
78
  # @return [String]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: henry-container
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.44
4
+ version: 0.0.45
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-02 00:00:00.000000000 Z
12
+ date: 2012-08-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -116,7 +116,6 @@ extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
118
  - .gitignore
119
- - .rvmrc
120
119
  - Gemfile
121
120
  - Rakefile
122
121
  - bin/henry-ruby-container
@@ -124,15 +123,7 @@ files:
124
123
  - henry-container.gemspec
125
124
  - henry-context.yml.sample
126
125
  - in.henry.sample
127
- - lib/.yardoc/checksums
128
- - lib/.yardoc/object_types
129
- - lib/.yardoc/objects/root.dat
130
- - lib/.yardoc/proxy_types
131
126
  - lib/henry.rb
132
- - lib/henry/.yardoc/checksums
133
- - lib/henry/.yardoc/object_types
134
- - lib/henry/.yardoc/objects/root.dat
135
- - lib/henry/.yardoc/proxy_types
136
127
  - lib/henry/container.rb
137
128
  - lib/henry/container/version.rb
138
129
  - lib/henry/environment.rb
@@ -166,4 +157,3 @@ signing_key:
166
157
  specification_version: 3
167
158
  summary: The Ruby Container for Henry
168
159
  test_files: []
169
- has_rdoc:
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm 1.9.3@ruby-container
File without changes
Binary file
Binary file
Binary file
File without changes
Binary file
Binary file
Binary file