cukedep 0.1.10 → 0.1.11

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.
Files changed (37) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG.md +4 -0
  3. data/Rakefile +4 -6
  4. data/lib/cukedep/application.rb +89 -91
  5. data/lib/cukedep/cli/cmd-line.rb +0 -7
  6. data/lib/cukedep/config.rb +70 -74
  7. data/lib/cukedep/constants.rb +1 -1
  8. data/lib/cukedep/cuke-runner.rb +0 -5
  9. data/lib/cukedep/customization.rb +0 -5
  10. data/lib/cukedep/feature-model.rb +1 -7
  11. data/lib/cukedep/feature-rep.rb +0 -4
  12. data/lib/cukedep/file-action.rb +209 -221
  13. data/lib/cukedep/gherkin-facade.rb +7 -10
  14. data/lib/cukedep/gherkin-listener.rb +82 -89
  15. data/lib/cukedep/hook-dsl.rb +0 -4
  16. data/lib/cukedep/sandbox.rb +0 -5
  17. data/sample/features/step_definitions/steps.rb +30 -26
  18. data/sample/features/support/env.rb +1 -1
  19. data/sample/model/model.rb +198 -205
  20. data/sample/result.html +1 -1
  21. data/spec/cukedep/application_spec.rb +15 -16
  22. data/spec/cukedep/cli/cmd-line_spec.rb +13 -16
  23. data/spec/cukedep/cuke-runner_spec.rb +55 -61
  24. data/spec/cukedep/customization_spec.rb +21 -26
  25. data/spec/cukedep/debug-file-action.rb +12 -10
  26. data/spec/cukedep/feature-model_spec.rb +13 -16
  27. data/spec/cukedep/feature-rep_spec.rb +4 -7
  28. data/spec/cukedep/file-action_spec.rb +18 -34
  29. data/spec/cukedep/file-parsing.rb +9 -11
  30. data/spec/cukedep/gherkin-facade_spec.rb +3 -8
  31. data/spec/cukedep/gherkin-listener_spec.rb +10 -12
  32. data/spec/cukedep/hook-dsl_spec.rb +6 -9
  33. data/spec/cukedep/sample_features/cukedep.rake +44 -37
  34. data/spec/cukedep/sample_features/cukedep_hooks.rb +2 -2
  35. data/spec/cukedep/sample_features/dependencies.dot +1 -1
  36. data/templates/rake.erb +36 -29
  37. metadata +2 -2
@@ -11,7 +11,7 @@ end
11
11
  # The code block will be executed just before
12
12
  # a Cucumber invocation.
13
13
  # The argument is a frozen Array of feature file names
14
- before_cuke(:each) do |filenames|
14
+ before_cuke(:each) do |_filenames|
15
15
  puts 'before each'
16
16
  end
17
17
 
@@ -27,4 +27,4 @@ after_cuke(:all) do
27
27
  puts 'after all'
28
28
  end
29
29
 
30
- # End of file
30
+ # End of file
@@ -2,7 +2,7 @@
2
2
  // 'C:/Ruby193/lib/ruby/site_ruby/Cukedep/spec/cukedep/sample_features'
3
3
  // This file uses the DOT syntax, a free utility from the Graphviz toolset.
4
4
  // Graphviz is available at: www.graphviz.org
5
- // File generated on Thu Apr 2 21:52:33 2015.
5
+ // File generated on Thu Jun 18 21:34:32 2015.
6
6
 
7
7
  digraph g {
8
8
  size = "7, 11"; // Dimensions in inches...
@@ -17,7 +17,7 @@ require 'rake'
17
17
  # Use development codebase
18
18
  require_relative '<%=rel_path.to_s + '/lib/cukedep/file-action'%>'
19
19
  <% else%>
20
- require 'cukedep/file-action'
20
+ require 'cukedep/file-action'
21
21
  <% end%>
22
22
 
23
23
  # Run Cucumber via specialized Rake task
@@ -25,19 +25,25 @@ require 'cucumber/rake/task'
25
25
  # UGLY workaround for bug in Cucumber's rake task
26
26
  if Gem::VERSION[0].to_i >= 2 && Cucumber::VERSION <= '1.3.2'
27
27
  # Monkey-patch a buggy method
28
- class Cucumber::Rake::Task::ForkedCucumberRunner
29
- def gem_available?(gemname)
30
- if Gem::VERSION[0].to_i >= 2
31
- gem_available_new_rubygems?(gemname)
32
- else
33
- gem_available_old_rubygems?(gemname)
28
+ module Cucumber
29
+ module Rake
30
+ module Task
31
+ class ForkedCucumberRunner
32
+ def gem_available?(gemname)
33
+ if Gem::VERSION[0].to_i >= 2
34
+ gem_available_new_rubygems?(gemname)
35
+ else
36
+ gem_available_old_rubygems?(gemname)
37
+ end
38
+ end
39
+ end
34
40
  end
35
- end
41
+ end
36
42
  end # class
37
43
  end
38
44
 
39
45
  # Create a task called cucumber
40
- Cucumber::Rake::Task.new do |t|
46
+ Cucumber::Rake::Task.new do |_|
41
47
  end
42
48
 
43
49
  #######################################
@@ -50,13 +56,14 @@ SOURCE_DIR = '<%=source_dir%>'
50
56
  # Constant holding the location of the Cucumber project
51
57
  CUKE_PROJECT = '<%=proj_dir%>'
52
58
 
53
- # The list of all "legacy" feature file (feature files without the @feature: tag)
54
- AllUnidentifiedFeatures = [<%anonymous_list = anonymous.map { |name| "'#{name}'"}%>
59
+ # The list of all "legacy" feature file
60
+ # (feature files without the @feature: tag)
61
+ AllUnidentifiedFeatures = [<%anonymous_list = anonymous.map {|nm| "'#{nm}'"}%>
55
62
  <%=anonymous_list.join(",\n ")%>
56
63
  ]
57
-
64
+
58
65
  # The list of all encountered feature ids
59
- AllFeatureIdentifiers = [ <%identifier_list = feature_ids.map {|f_id| ":#{f_id}"}%>
66
+ AllFeatureIdentifiers = [ <%identifier_list = feature_ids.map {|fid| ":#{fid}"}%>
60
67
  <%=identifier_list.join(",\n ")%>
61
68
  ]
62
69
 
@@ -78,7 +85,7 @@ def project_path_of(aFilename)
78
85
  CUKE_PROJECT + '/features/' + aFilename
79
86
  end
80
87
 
81
- # Helper method. Given the name of files in the source dir, copy them
88
+ # Helper method. Given the name of files in the source dir, copy them
82
89
  # into the project dir.
83
90
  def copy_to_project(filenames)
84
91
  filenames.each do |fname|
@@ -89,7 +96,7 @@ def copy_to_project(filenames)
89
96
  end
90
97
 
91
98
 
92
- # Helper method. Given the name of files in the features dir of the project,
99
+ # Helper method. Given the name of files in the features dir of the project,
93
100
  # copy them into the source dir.
94
101
  def copy_from_project(*filenames)
95
102
  filenames.each do |fname|
@@ -99,28 +106,28 @@ def copy_from_project(*filenames)
99
106
  end
100
107
  end
101
108
 
102
- # Helper method. Delete all the files in the
103
- # the project's features dir that match one of
109
+ # Helper method. Delete all the files in the
110
+ # the project's features dir that match one of
104
111
  # the file name pattern
105
112
  def clean_project_dir(fname_patterns)
106
- curr_dir = Dir.getwd()
113
+ curr_dir = Dir.getwd
107
114
  begin
108
115
  Dir.chdir(CUKE_PROJECT + '/features')
109
116
  fname_patterns.each do |patt|
110
117
  filenames = Dir.glob(patt)
111
118
  filenames.each { |fn| FileUtils.remove_file(fn) }
112
119
  end
113
- ensure #Always restore previous working dir.
120
+ ensure # Always restore previous working dir.
114
121
  Dir.chdir(curr_dir)
115
122
  end
116
123
  end
117
124
 
118
125
 
119
126
  # Helper method. Invoke Cucumber with the given project root dir.
120
- # Assumption: all features files to execute are placed
127
+ # Assumption: all features files to execute are placed
121
128
  # in the appropriate folder.
122
129
  def invoke_cuke(projectDir)
123
- curr_dir = Dir.getwd()
130
+ curr_dir = Dir.getwd
124
131
  Dir.chdir(projectDir)
125
132
  begin
126
133
  do_cuke = Rake::Task[:cucumber]
@@ -137,7 +144,7 @@ def process_files(filenames)
137
144
  copy_to_project(filenames)
138
145
  invoke_cuke(CUKE_PROJECT)
139
146
  run_builtin_actions(:after_each)
140
- #del_from_project(filenames)
147
+ # del_from_project(filenames)
141
148
  end
142
149
 
143
150
  def process_a_feature(filename)
@@ -146,16 +153,16 @@ end
146
153
 
147
154
 
148
155
  # Default rake task is also top-level task
149
- task :default => :run_all_features
156
+ task default: :run_all_features
150
157
 
151
158
 
152
159
  desc 'Run all features'
153
- task :run_all_features => [:before_all, :all_features, :after_all] do
160
+ task run_all_features: [:before_all, :all_features, :after_all] do
154
161
  ; # Do nothing
155
162
  end
156
163
 
157
164
 
158
- desc 'Before all'
165
+ desc 'Before all'
159
166
  task :before_all do
160
167
  run_builtin_actions(:before_all)
161
168
  end
@@ -173,13 +180,13 @@ end
173
180
  # Tasks for feature files involved in dependencies
174
181
  <%deps.each do |dep|%>
175
182
  <%dep_list = dep.dependents.map { |ff| ":#{ff.feature.identifier}" } %>
176
- desc "<%=dep.dependee.feature.identifier%>: run <%=dep.dependee.basename%>"
177
- task :<%=dep.dependee.feature.identifier%> <%= dep_list.empty? ? '' : %Q|=> [#{dep_list.join(', ') }]| %> do
183
+ desc '<%=dep.dependee.feature.identifier%>: run <%=dep.dependee.basename%>'
184
+ task <%=dep.dependee.feature.identifier%><%= dep_list.empty? ? '' : %Q|: [#{dep_list.join(', ') }]| %> do
178
185
  process_a_feature('<%=dep.dependee.basename%>')
179
186
  end
180
187
  <%end%>
181
188
 
182
- task :all_features => ([:unidentified] + AllFeatureIdentifiers) do
189
+ task all_features: ([:unidentified] + AllFeatureIdentifiers) do
183
190
  end
184
191
 
185
- # End of file
192
+ # End of file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cukedep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitri Geshef
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-02 00:00:00.000000000 Z
11
+ date: 2015-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber