cucover 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. data/.gitignore +6 -0
  2. data/Licence.txt +22 -0
  3. data/README.markdown +69 -0
  4. data/Rakefile +86 -0
  5. data/VERSION +1 -0
  6. data/bin/cucover +3 -0
  7. data/cucover.gemspec +182 -0
  8. data/cucumber.yml +3 -0
  9. data/examples/self_test/rails/.gitignore +4 -0
  10. data/examples/self_test/rails/Rakefile +10 -0
  11. data/examples/self_test/rails/app/controllers/application_controller.rb +2 -0
  12. data/examples/self_test/rails/app/controllers/widgets_controller.rb +2 -0
  13. data/examples/self_test/rails/app/helpers/application_helper.rb +3 -0
  14. data/examples/self_test/rails/app/views/widgets/index.html.erb +1 -0
  15. data/examples/self_test/rails/config/boot.rb +110 -0
  16. data/examples/self_test/rails/config/cucumber.yml +7 -0
  17. data/examples/self_test/rails/config/database.yml +25 -0
  18. data/examples/self_test/rails/config/environment.rb +41 -0
  19. data/examples/self_test/rails/config/environments/cucumber.rb +27 -0
  20. data/examples/self_test/rails/config/environments/development.rb +17 -0
  21. data/examples/self_test/rails/config/environments/production.rb +28 -0
  22. data/examples/self_test/rails/config/environments/test.rb +28 -0
  23. data/examples/self_test/rails/config/initializers/backtrace_silencers.rb +7 -0
  24. data/examples/self_test/rails/config/initializers/inflections.rb +10 -0
  25. data/examples/self_test/rails/config/initializers/mime_types.rb +5 -0
  26. data/examples/self_test/rails/config/initializers/new_rails_defaults.rb +21 -0
  27. data/examples/self_test/rails/config/initializers/session_store.rb +15 -0
  28. data/examples/self_test/rails/config/locales/en.yml +5 -0
  29. data/examples/self_test/rails/config/routes.rb +43 -0
  30. data/examples/self_test/rails/db/seeds.rb +7 -0
  31. data/examples/self_test/rails/features/see_widgets.feature +7 -0
  32. data/examples/self_test/rails/features/step_definitions/web_steps.rb +273 -0
  33. data/examples/self_test/rails/features/support/env.rb +57 -0
  34. data/examples/self_test/rails/features/support/paths.rb +29 -0
  35. data/examples/self_test/rails/lib/tasks/cucumber.rake +47 -0
  36. data/examples/self_test/rails/public/404.html +30 -0
  37. data/examples/self_test/rails/public/422.html +30 -0
  38. data/examples/self_test/rails/public/500.html +30 -0
  39. data/examples/self_test/rails/public/favicon.ico +0 -0
  40. data/examples/self_test/rails/public/images/rails.png +0 -0
  41. data/examples/self_test/rails/public/index.html +275 -0
  42. data/examples/self_test/rails/public/javascripts/application.js +2 -0
  43. data/examples/self_test/rails/public/javascripts/controls.js +963 -0
  44. data/examples/self_test/rails/public/javascripts/dragdrop.js +973 -0
  45. data/examples/self_test/rails/public/javascripts/effects.js +1128 -0
  46. data/examples/self_test/rails/public/javascripts/prototype.js +4320 -0
  47. data/examples/self_test/rails/public/robots.txt +5 -0
  48. data/examples/self_test/rails/script/about +4 -0
  49. data/examples/self_test/rails/script/console +3 -0
  50. data/examples/self_test/rails/script/cucumber +10 -0
  51. data/examples/self_test/rails/script/dbconsole +3 -0
  52. data/examples/self_test/rails/script/destroy +3 -0
  53. data/examples/self_test/rails/script/generate +3 -0
  54. data/examples/self_test/rails/script/performance/benchmarker +3 -0
  55. data/examples/self_test/rails/script/performance/profiler +3 -0
  56. data/examples/self_test/rails/script/plugin +3 -0
  57. data/examples/self_test/rails/script/runner +3 -0
  58. data/examples/self_test/rails/script/server +3 -0
  59. data/examples/self_test/simple/features/call_foo.feature +4 -0
  60. data/examples/self_test/simple/features/call_foo_and_bar_together.feature +5 -0
  61. data/examples/self_test/simple/features/call_foo_from_background_then_bar.feature +7 -0
  62. data/examples/self_test/simple/features/call_foo_from_background_then_bar_then_baz.feature +10 -0
  63. data/examples/self_test/simple/features/call_foo_then_bar.feature +7 -0
  64. data/examples/self_test/simple/features/call_foo_then_bar_from_scenario_outline_examples.feature +9 -0
  65. data/examples/self_test/simple/features/fail.feature +10 -0
  66. data/examples/self_test/simple/features/step_definitions/main_steps.rb +15 -0
  67. data/examples/self_test/simple/lib/bar.rb +5 -0
  68. data/examples/self_test/simple/lib/baz.rb +5 -0
  69. data/examples/self_test/simple/lib/foo.rb +9 -0
  70. data/features/call_foo.feature +0 -0
  71. data/features/coverage_of.feature +81 -0
  72. data/features/fail.feature +60 -0
  73. data/features/help.feature +15 -0
  74. data/features/lazy_run.feature +76 -0
  75. data/features/lazy_run_per_scenario.feature +108 -0
  76. data/features/lazy_run_per_scenario_outline_example.feature +29 -0
  77. data/features/lazy_run_triggered_by_rails_view_change.feature +43 -0
  78. data/features/run.feature +25 -0
  79. data/features/show_recordings.feature +28 -0
  80. data/features/step_definitions/main_steps.rb +41 -0
  81. data/features/support/env.rb +52 -0
  82. data/lib/at_exit_hook.rb +3 -0
  83. data/lib/cucover.rb +65 -0
  84. data/lib/cucover/cli.rb +50 -0
  85. data/lib/cucover/cli_commands/coverage_of.rb +44 -0
  86. data/lib/cucover/cli_commands/cucumber.rb +46 -0
  87. data/lib/cucover/cli_commands/show_recordings.rb +29 -0
  88. data/lib/cucover/cli_commands/version.rb +13 -0
  89. data/lib/cucover/controller.rb +28 -0
  90. data/lib/cucover/cucumber_hooks.rb +45 -0
  91. data/lib/cucover/line_numbers.rb +10 -0
  92. data/lib/cucover/logging_config.rb +16 -0
  93. data/lib/cucover/monkey.rb +14 -0
  94. data/lib/cucover/rails.rb +23 -0
  95. data/lib/cucover/recorder.rb +37 -0
  96. data/lib/cucover/recording.rb +66 -0
  97. data/lib/cucover/recording/covered_file.rb +53 -0
  98. data/lib/cucover/store.rb +70 -0
  99. data/lib/dependencies.rb +10 -0
  100. data/spec/cucover/cli_spec.rb +31 -0
  101. data/spec/cucover/controller_spec.rb +16 -0
  102. data/spec/cucover/recording/covered_file_spec.rb +20 -0
  103. data/spec/cucover/store_spec.rb +28 -0
  104. data/spec/spec_helper.rb +7 -0
  105. data/tmp/.gitignore +0 -0
  106. metadata +236 -0
@@ -0,0 +1,20 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ class Cucover::Recording
4
+ describe CoveredFile do
5
+ describe "with a marked info" do
6
+ before(:each) do
7
+ @recording = mock('Recording')
8
+ @covered_file = CoveredFile.new("foo.rb", [true, true, false], @recording)
9
+ end
10
+
11
+ it "should set the covered_lines correctly from the marked info" do
12
+ [1,2].each do |line_number|
13
+ @covered_file.covers_line?(line_number).should be_true
14
+ end
15
+
16
+ @covered_file.covers_line?(3).should be_false
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,28 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ module Cucover
4
+ describe Store do
5
+ before(:each) do
6
+ @cache = mock('cache', :load => nil)
7
+ @store = Store.new(@cache)
8
+ end
9
+ describe "#latest_recording" do
10
+ it "should return nil if no recordings match the given identifier" do
11
+ @store.latest_recording('blah:234').should be_nil
12
+ end
13
+
14
+ describe "when multiple recordings match the given indentifier" do
15
+ before(:each) do
16
+ old_recording = mock('old data', :end_time => Time.now - 200)
17
+ @new_recording = mock('new data', :end_time => Time.now)
18
+ @cache.stub!(:load).and_return({
19
+ 'foo.feature:33' => [ old_recording, @new_recording ]
20
+ })
21
+ end
22
+ it "should return the one with the latest end_time" do
23
+ @store.latest_recording('foo.feature:33').should == @new_recording
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ gem 'rspec'
3
+ require 'spec'
4
+ require 'spec/mocks/framework'
5
+
6
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
7
+ require 'cucover'
File without changes
metadata ADDED
@@ -0,0 +1,236 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cucover
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 2
9
+ version: 0.1.2
10
+ platform: ruby
11
+ authors:
12
+ - Matt Wynne
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-04-08 00:00:00 +01:00
18
+ default_executable: cucover
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: cucumber
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 3
30
+ - 11
31
+ version: 0.3.11
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: relevance-rcov
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ - 8
44
+ - 3
45
+ - 4
46
+ version: 0.8.3.4
47
+ type: :runtime
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: logging
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ segments:
57
+ - 1
58
+ - 1
59
+ - 4
60
+ version: 1.1.4
61
+ type: :runtime
62
+ version_requirements: *id003
63
+ description: Lazy coverage-aware running of Cucumber acceptance tests
64
+ email: matt@mattwynne.net
65
+ executables:
66
+ - cucover
67
+ extensions: []
68
+
69
+ extra_rdoc_files:
70
+ - README.markdown
71
+ files:
72
+ - .gitignore
73
+ - Licence.txt
74
+ - README.markdown
75
+ - Rakefile
76
+ - VERSION
77
+ - bin/cucover
78
+ - cucover.gemspec
79
+ - cucumber.yml
80
+ - examples/self_test/rails/.gitignore
81
+ - examples/self_test/rails/Rakefile
82
+ - examples/self_test/rails/app/controllers/application_controller.rb
83
+ - examples/self_test/rails/app/controllers/widgets_controller.rb
84
+ - examples/self_test/rails/app/helpers/application_helper.rb
85
+ - examples/self_test/rails/app/views/widgets/index.html.erb
86
+ - examples/self_test/rails/config/boot.rb
87
+ - examples/self_test/rails/config/cucumber.yml
88
+ - examples/self_test/rails/config/database.yml
89
+ - examples/self_test/rails/config/environment.rb
90
+ - examples/self_test/rails/config/environments/cucumber.rb
91
+ - examples/self_test/rails/config/environments/development.rb
92
+ - examples/self_test/rails/config/environments/production.rb
93
+ - examples/self_test/rails/config/environments/test.rb
94
+ - examples/self_test/rails/config/initializers/backtrace_silencers.rb
95
+ - examples/self_test/rails/config/initializers/inflections.rb
96
+ - examples/self_test/rails/config/initializers/mime_types.rb
97
+ - examples/self_test/rails/config/initializers/new_rails_defaults.rb
98
+ - examples/self_test/rails/config/initializers/session_store.rb
99
+ - examples/self_test/rails/config/locales/en.yml
100
+ - examples/self_test/rails/config/routes.rb
101
+ - examples/self_test/rails/db/seeds.rb
102
+ - examples/self_test/rails/db/test.sqlite3
103
+ - examples/self_test/rails/features/see_widgets.feature
104
+ - examples/self_test/rails/features/step_definitions/web_steps.rb
105
+ - examples/self_test/rails/features/support/env.rb
106
+ - examples/self_test/rails/features/support/paths.rb
107
+ - examples/self_test/rails/lib/tasks/cucumber.rake
108
+ - examples/self_test/rails/public/404.html
109
+ - examples/self_test/rails/public/422.html
110
+ - examples/self_test/rails/public/500.html
111
+ - examples/self_test/rails/public/favicon.ico
112
+ - examples/self_test/rails/public/images/rails.png
113
+ - examples/self_test/rails/public/index.html
114
+ - examples/self_test/rails/public/javascripts/application.js
115
+ - examples/self_test/rails/public/javascripts/controls.js
116
+ - examples/self_test/rails/public/javascripts/dragdrop.js
117
+ - examples/self_test/rails/public/javascripts/effects.js
118
+ - examples/self_test/rails/public/javascripts/prototype.js
119
+ - examples/self_test/rails/public/robots.txt
120
+ - examples/self_test/rails/script/about
121
+ - examples/self_test/rails/script/console
122
+ - examples/self_test/rails/script/cucumber
123
+ - examples/self_test/rails/script/dbconsole
124
+ - examples/self_test/rails/script/destroy
125
+ - examples/self_test/rails/script/generate
126
+ - examples/self_test/rails/script/performance/benchmarker
127
+ - examples/self_test/rails/script/performance/profiler
128
+ - examples/self_test/rails/script/plugin
129
+ - examples/self_test/rails/script/runner
130
+ - examples/self_test/rails/script/server
131
+ - examples/self_test/simple/features/call_foo.feature
132
+ - examples/self_test/simple/features/call_foo_and_bar_together.feature
133
+ - examples/self_test/simple/features/call_foo_from_background_then_bar.feature
134
+ - examples/self_test/simple/features/call_foo_from_background_then_bar_then_baz.feature
135
+ - examples/self_test/simple/features/call_foo_then_bar.feature
136
+ - examples/self_test/simple/features/call_foo_then_bar_from_scenario_outline_examples.feature
137
+ - examples/self_test/simple/features/fail.feature
138
+ - examples/self_test/simple/features/step_definitions/main_steps.rb
139
+ - examples/self_test/simple/lib/bar.rb
140
+ - examples/self_test/simple/lib/baz.rb
141
+ - examples/self_test/simple/lib/foo.rb
142
+ - features/call_foo.feature
143
+ - features/coverage_of.feature
144
+ - features/fail.feature
145
+ - features/help.feature
146
+ - features/lazy_run.feature
147
+ - features/lazy_run_per_scenario.feature
148
+ - features/lazy_run_per_scenario_outline_example.feature
149
+ - features/lazy_run_triggered_by_rails_view_change.feature
150
+ - features/run.feature
151
+ - features/show_recordings.feature
152
+ - features/step_definitions/main_steps.rb
153
+ - features/support/env.rb
154
+ - lib/at_exit_hook.rb
155
+ - lib/cucover.rb
156
+ - lib/cucover/cli.rb
157
+ - lib/cucover/cli_commands/coverage_of.rb
158
+ - lib/cucover/cli_commands/cucumber.rb
159
+ - lib/cucover/cli_commands/show_recordings.rb
160
+ - lib/cucover/cli_commands/version.rb
161
+ - lib/cucover/controller.rb
162
+ - lib/cucover/cucumber_hooks.rb
163
+ - lib/cucover/line_numbers.rb
164
+ - lib/cucover/logging_config.rb
165
+ - lib/cucover/monkey.rb
166
+ - lib/cucover/rails.rb
167
+ - lib/cucover/recorder.rb
168
+ - lib/cucover/recording.rb
169
+ - lib/cucover/recording/covered_file.rb
170
+ - lib/cucover/store.rb
171
+ - lib/dependencies.rb
172
+ - spec/cucover/cli_spec.rb
173
+ - spec/cucover/controller_spec.rb
174
+ - spec/cucover/recording/covered_file_spec.rb
175
+ - spec/cucover/store_spec.rb
176
+ - spec/spec_helper.rb
177
+ - tmp/.gitignore
178
+ has_rdoc: true
179
+ homepage: http://github.com/mattwynne/cucover/
180
+ licenses: []
181
+
182
+ post_install_message:
183
+ rdoc_options:
184
+ - --charset=UTF-8
185
+ require_paths:
186
+ - lib
187
+ required_ruby_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ segments:
192
+ - 0
193
+ version: "0"
194
+ required_rubygems_version: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - ">="
197
+ - !ruby/object:Gem::Version
198
+ segments:
199
+ - 0
200
+ version: "0"
201
+ requirements: []
202
+
203
+ rubyforge_project:
204
+ rubygems_version: 1.3.6
205
+ signing_key:
206
+ specification_version: 3
207
+ summary: Lazy coverage-aware running of Cucumber acceptance tests
208
+ test_files:
209
+ - spec/cucover/cli_spec.rb
210
+ - spec/cucover/controller_spec.rb
211
+ - spec/cucover/recording/covered_file_spec.rb
212
+ - spec/cucover/store_spec.rb
213
+ - spec/spec_helper.rb
214
+ - examples/self_test/rails/app/controllers/application_controller.rb
215
+ - examples/self_test/rails/app/controllers/widgets_controller.rb
216
+ - examples/self_test/rails/app/helpers/application_helper.rb
217
+ - examples/self_test/rails/config/boot.rb
218
+ - examples/self_test/rails/config/environment.rb
219
+ - examples/self_test/rails/config/environments/cucumber.rb
220
+ - examples/self_test/rails/config/environments/development.rb
221
+ - examples/self_test/rails/config/environments/production.rb
222
+ - examples/self_test/rails/config/environments/test.rb
223
+ - examples/self_test/rails/config/initializers/backtrace_silencers.rb
224
+ - examples/self_test/rails/config/initializers/inflections.rb
225
+ - examples/self_test/rails/config/initializers/mime_types.rb
226
+ - examples/self_test/rails/config/initializers/new_rails_defaults.rb
227
+ - examples/self_test/rails/config/initializers/session_store.rb
228
+ - examples/self_test/rails/config/routes.rb
229
+ - examples/self_test/rails/db/seeds.rb
230
+ - examples/self_test/rails/features/step_definitions/web_steps.rb
231
+ - examples/self_test/rails/features/support/env.rb
232
+ - examples/self_test/rails/features/support/paths.rb
233
+ - examples/self_test/simple/features/step_definitions/main_steps.rb
234
+ - examples/self_test/simple/lib/bar.rb
235
+ - examples/self_test/simple/lib/baz.rb
236
+ - examples/self_test/simple/lib/foo.rb