cucover 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/Licence.txt +22 -0
- data/README.markdown +69 -0
- data/Rakefile +86 -0
- data/VERSION +1 -0
- data/bin/cucover +3 -0
- data/cucover.gemspec +182 -0
- data/cucumber.yml +3 -0
- data/examples/self_test/rails/.gitignore +4 -0
- data/examples/self_test/rails/Rakefile +10 -0
- data/examples/self_test/rails/app/controllers/application_controller.rb +2 -0
- data/examples/self_test/rails/app/controllers/widgets_controller.rb +2 -0
- data/examples/self_test/rails/app/helpers/application_helper.rb +3 -0
- data/examples/self_test/rails/app/views/widgets/index.html.erb +1 -0
- data/examples/self_test/rails/config/boot.rb +110 -0
- data/examples/self_test/rails/config/cucumber.yml +7 -0
- data/examples/self_test/rails/config/database.yml +25 -0
- data/examples/self_test/rails/config/environment.rb +41 -0
- data/examples/self_test/rails/config/environments/cucumber.rb +27 -0
- data/examples/self_test/rails/config/environments/development.rb +17 -0
- data/examples/self_test/rails/config/environments/production.rb +28 -0
- data/examples/self_test/rails/config/environments/test.rb +28 -0
- data/examples/self_test/rails/config/initializers/backtrace_silencers.rb +7 -0
- data/examples/self_test/rails/config/initializers/inflections.rb +10 -0
- data/examples/self_test/rails/config/initializers/mime_types.rb +5 -0
- data/examples/self_test/rails/config/initializers/new_rails_defaults.rb +21 -0
- data/examples/self_test/rails/config/initializers/session_store.rb +15 -0
- data/examples/self_test/rails/config/locales/en.yml +5 -0
- data/examples/self_test/rails/config/routes.rb +43 -0
- data/examples/self_test/rails/db/seeds.rb +7 -0
- data/examples/self_test/rails/features/see_widgets.feature +7 -0
- data/examples/self_test/rails/features/step_definitions/web_steps.rb +273 -0
- data/examples/self_test/rails/features/support/env.rb +57 -0
- data/examples/self_test/rails/features/support/paths.rb +29 -0
- data/examples/self_test/rails/lib/tasks/cucumber.rake +47 -0
- data/examples/self_test/rails/public/404.html +30 -0
- data/examples/self_test/rails/public/422.html +30 -0
- data/examples/self_test/rails/public/500.html +30 -0
- data/examples/self_test/rails/public/favicon.ico +0 -0
- data/examples/self_test/rails/public/images/rails.png +0 -0
- data/examples/self_test/rails/public/index.html +275 -0
- data/examples/self_test/rails/public/javascripts/application.js +2 -0
- data/examples/self_test/rails/public/javascripts/controls.js +963 -0
- data/examples/self_test/rails/public/javascripts/dragdrop.js +973 -0
- data/examples/self_test/rails/public/javascripts/effects.js +1128 -0
- data/examples/self_test/rails/public/javascripts/prototype.js +4320 -0
- data/examples/self_test/rails/public/robots.txt +5 -0
- data/examples/self_test/rails/script/about +4 -0
- data/examples/self_test/rails/script/console +3 -0
- data/examples/self_test/rails/script/cucumber +10 -0
- data/examples/self_test/rails/script/dbconsole +3 -0
- data/examples/self_test/rails/script/destroy +3 -0
- data/examples/self_test/rails/script/generate +3 -0
- data/examples/self_test/rails/script/performance/benchmarker +3 -0
- data/examples/self_test/rails/script/performance/profiler +3 -0
- data/examples/self_test/rails/script/plugin +3 -0
- data/examples/self_test/rails/script/runner +3 -0
- data/examples/self_test/rails/script/server +3 -0
- data/examples/self_test/simple/features/call_foo.feature +4 -0
- data/examples/self_test/simple/features/call_foo_and_bar_together.feature +5 -0
- data/examples/self_test/simple/features/call_foo_from_background_then_bar.feature +7 -0
- data/examples/self_test/simple/features/call_foo_from_background_then_bar_then_baz.feature +10 -0
- data/examples/self_test/simple/features/call_foo_then_bar.feature +7 -0
- data/examples/self_test/simple/features/call_foo_then_bar_from_scenario_outline_examples.feature +9 -0
- data/examples/self_test/simple/features/fail.feature +10 -0
- data/examples/self_test/simple/features/step_definitions/main_steps.rb +15 -0
- data/examples/self_test/simple/lib/bar.rb +5 -0
- data/examples/self_test/simple/lib/baz.rb +5 -0
- data/examples/self_test/simple/lib/foo.rb +9 -0
- data/features/call_foo.feature +0 -0
- data/features/coverage_of.feature +81 -0
- data/features/fail.feature +60 -0
- data/features/help.feature +15 -0
- data/features/lazy_run.feature +76 -0
- data/features/lazy_run_per_scenario.feature +108 -0
- data/features/lazy_run_per_scenario_outline_example.feature +29 -0
- data/features/lazy_run_triggered_by_rails_view_change.feature +43 -0
- data/features/run.feature +25 -0
- data/features/show_recordings.feature +28 -0
- data/features/step_definitions/main_steps.rb +41 -0
- data/features/support/env.rb +52 -0
- data/lib/at_exit_hook.rb +3 -0
- data/lib/cucover.rb +65 -0
- data/lib/cucover/cli.rb +50 -0
- data/lib/cucover/cli_commands/coverage_of.rb +44 -0
- data/lib/cucover/cli_commands/cucumber.rb +46 -0
- data/lib/cucover/cli_commands/show_recordings.rb +29 -0
- data/lib/cucover/cli_commands/version.rb +13 -0
- data/lib/cucover/controller.rb +28 -0
- data/lib/cucover/cucumber_hooks.rb +45 -0
- data/lib/cucover/line_numbers.rb +10 -0
- data/lib/cucover/logging_config.rb +16 -0
- data/lib/cucover/monkey.rb +14 -0
- data/lib/cucover/rails.rb +23 -0
- data/lib/cucover/recorder.rb +37 -0
- data/lib/cucover/recording.rb +66 -0
- data/lib/cucover/recording/covered_file.rb +53 -0
- data/lib/cucover/store.rb +70 -0
- data/lib/dependencies.rb +10 -0
- data/spec/cucover/cli_spec.rb +31 -0
- data/spec/cucover/controller_spec.rb +16 -0
- data/spec/cucover/recording/covered_file_spec.rb +20 -0
- data/spec/cucover/store_spec.rb +28 -0
- data/spec/spec_helper.rb +7 -0
- data/tmp/.gitignore +0 -0
- metadata +236 -0
data/.gitignore
ADDED
data/Licence.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) 2009 Matt Wynne
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# Cucover
|
2
|
+
|
3
|
+
Cucover is a thin wrapper for [Cucumber](http://github.com/aslakhellesoy/cucumber/tree/master) which makes it lazy.
|
4
|
+
|
5
|
+
>> Question:
|
6
|
+
>> What does it mean for Cucumber to be lazy?
|
7
|
+
|
8
|
+
> Answer:
|
9
|
+
> It will only run a scenario if it needs to.
|
10
|
+
|
11
|
+
How does it decide whether it needs to run a scenario? Every time you run a feature using Cucover, it watches the code in your application that is executed, and remembers. The next time you run Cucover, it skips a scenario if the source files (or the feature itself) have not been changed since it was last run.
|
12
|
+
|
13
|
+
## Features
|
14
|
+
|
15
|
+
* Within a feature, Cucover will only re-run the Scenarios that have been affected by your changes
|
16
|
+
* Uses RCov to map features to covered source files
|
17
|
+
* Patches Rails to also map scenarios to covered .erb view templates
|
18
|
+
* Shows skipped Scenarios, for confidence
|
19
|
+
* Re-runs failing features, even when nothing has changed, for that good old red-bar feel.
|
20
|
+
* Allows you to see which lines of a source file are tested by which scenarios
|
21
|
+
|
22
|
+
## Installation and Usage
|
23
|
+
|
24
|
+
sudo gem install mattwynne-cucover --source http://gems.github.com
|
25
|
+
|
26
|
+
To run your features lazily, use the cucover binary instead of cucumber:
|
27
|
+
|
28
|
+
cucover -- features/lamb_chops.feature
|
29
|
+
|
30
|
+
To see what Cucover has already recorded (in the cucover.data file):
|
31
|
+
|
32
|
+
cucover --show-recordings
|
33
|
+
|
34
|
+
To find out which tests cover which lines of a given source file:
|
35
|
+
|
36
|
+
cucover --coverage_of path/to/some_source_file.rb
|
37
|
+
|
38
|
+
## Limitations
|
39
|
+
|
40
|
+
* Anything that runs out of process will not be covered, and therefore cannot trigger a re-run, so if you use Cucumber to drive Selenium, for example, you're out of luck.
|
41
|
+
* This is very new and experimental. There may be bugs. Feedback is welcome via github messages.
|
42
|
+
|
43
|
+
## Todo
|
44
|
+
* Proper args parsing and command-line help
|
45
|
+
* Work on a way to include coverage from out-of-process ruby code run during a test
|
46
|
+
* Speed up the whole thing by only writing the recordings to disk when the process exits
|
47
|
+
* Run code coverage and remove any slop following refactoring
|
48
|
+
* Speed up the Rails test - maybe strip some guff out of the environment load?
|
49
|
+
|
50
|
+
## Similar 'Selective Testing' Tools
|
51
|
+
|
52
|
+
* JTestMe
|
53
|
+
* http://xircles.codehaus.org/projects/jtestme
|
54
|
+
* [Agile2008 conference submission](http://submissions.agile2008.org/node/3435)
|
55
|
+
* Infinitest
|
56
|
+
* http://code.google.com/p/infinitest/
|
57
|
+
* Contact: [Ben Rady](http://submissions.agile2008.org/node/377)
|
58
|
+
* Google Testar
|
59
|
+
* http://code.google.com/p/google-testar/
|
60
|
+
* Contact: Misha Dmitriev
|
61
|
+
* Clover test optimization
|
62
|
+
* http://www.atlassian.com/software/clover/features/optimization.jsp
|
63
|
+
* JUnitMax
|
64
|
+
* a selective testing tool by [Kent Beck](http://www.threeriversinstitute.org/blog)
|
65
|
+
* http://junitmax.com/
|
66
|
+
|
67
|
+
## Authors
|
68
|
+
* Matt Wynne
|
69
|
+
* Joseph Wilk
|
data/Rakefile
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'cucumber/rake/task'
|
2
|
+
|
3
|
+
module Cucover
|
4
|
+
module Rake
|
5
|
+
class Task < Cucumber::Rake::Task
|
6
|
+
def feature_pattern=(value)
|
7
|
+
@feature_pattern = value
|
8
|
+
end
|
9
|
+
|
10
|
+
def pretty!
|
11
|
+
@format = 'pretty'
|
12
|
+
end
|
13
|
+
|
14
|
+
def tags=(value)
|
15
|
+
@tags = value
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def feature_pattern
|
21
|
+
@feature_pattern || 'features/**/*.feature'
|
22
|
+
end
|
23
|
+
|
24
|
+
def feature_files(task_arguments = nil)
|
25
|
+
FileList[feature_pattern]
|
26
|
+
end
|
27
|
+
|
28
|
+
def formatters
|
29
|
+
[
|
30
|
+
'-f', 'rerun', '-o', 'rerun',
|
31
|
+
'-f', @format || 'progress',
|
32
|
+
]
|
33
|
+
end
|
34
|
+
|
35
|
+
def tags
|
36
|
+
return [] unless @tags
|
37
|
+
[ '-t', @tags ]
|
38
|
+
end
|
39
|
+
|
40
|
+
def cucumber_opts
|
41
|
+
formatters + tags
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def rerun
|
48
|
+
return nil unless File.exist?('rerun')
|
49
|
+
result = File.read('rerun').strip
|
50
|
+
return nil if result.empty?
|
51
|
+
result
|
52
|
+
end
|
53
|
+
|
54
|
+
Cucover::Rake::Task.new(:default) do |t|
|
55
|
+
t.tags = '~in-progress'
|
56
|
+
end
|
57
|
+
|
58
|
+
Cucover::Rake::Task.new(:all)
|
59
|
+
|
60
|
+
Cucover::Rake::Task.new(:failed) do |t|
|
61
|
+
t.pretty!
|
62
|
+
t.feature_pattern = rerun if rerun
|
63
|
+
end
|
64
|
+
|
65
|
+
Cucumber::Rake::Task.new(:coverage) do |t|
|
66
|
+
t.rcov = true
|
67
|
+
t.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/}
|
68
|
+
end
|
69
|
+
|
70
|
+
begin
|
71
|
+
require 'jeweler'
|
72
|
+
Jeweler::Tasks.new do |gemspec|
|
73
|
+
gemspec.name = "cucover"
|
74
|
+
gemspec.summary = "Lazy coverage-aware running of Cucumber acceptance tests"
|
75
|
+
gemspec.email = "matt@mattwynne.net"
|
76
|
+
gemspec.homepage = "http://github.com/mattwynne/cucover/"
|
77
|
+
gemspec.description = "Lazy coverage-aware running of Cucumber acceptance tests"
|
78
|
+
gemspec.authors = ["Matt Wynne"]
|
79
|
+
|
80
|
+
gemspec.add_dependency('cucumber', '>= 0.3.11')
|
81
|
+
gemspec.add_dependency('relevance-rcov', '>= 0.8.3.4')
|
82
|
+
gemspec.add_dependency('logging', '>= 1.1.4')
|
83
|
+
end
|
84
|
+
rescue LoadError
|
85
|
+
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
86
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.2
|
data/bin/cucover
ADDED
data/cucover.gemspec
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{cucover}
|
8
|
+
s.version = "0.1.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Matt Wynne"]
|
12
|
+
s.date = %q{2010-04-08}
|
13
|
+
s.default_executable = %q{cucover}
|
14
|
+
s.description = %q{Lazy coverage-aware running of Cucumber acceptance tests}
|
15
|
+
s.email = %q{matt@mattwynne.net}
|
16
|
+
s.executables = ["cucover"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"README.markdown"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".gitignore",
|
22
|
+
"Licence.txt",
|
23
|
+
"README.markdown",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"bin/cucover",
|
27
|
+
"cucover.gemspec",
|
28
|
+
"cucumber.yml",
|
29
|
+
"examples/self_test/rails/.gitignore",
|
30
|
+
"examples/self_test/rails/Rakefile",
|
31
|
+
"examples/self_test/rails/app/controllers/application_controller.rb",
|
32
|
+
"examples/self_test/rails/app/controllers/widgets_controller.rb",
|
33
|
+
"examples/self_test/rails/app/helpers/application_helper.rb",
|
34
|
+
"examples/self_test/rails/app/views/widgets/index.html.erb",
|
35
|
+
"examples/self_test/rails/config/boot.rb",
|
36
|
+
"examples/self_test/rails/config/cucumber.yml",
|
37
|
+
"examples/self_test/rails/config/database.yml",
|
38
|
+
"examples/self_test/rails/config/environment.rb",
|
39
|
+
"examples/self_test/rails/config/environments/cucumber.rb",
|
40
|
+
"examples/self_test/rails/config/environments/development.rb",
|
41
|
+
"examples/self_test/rails/config/environments/production.rb",
|
42
|
+
"examples/self_test/rails/config/environments/test.rb",
|
43
|
+
"examples/self_test/rails/config/initializers/backtrace_silencers.rb",
|
44
|
+
"examples/self_test/rails/config/initializers/inflections.rb",
|
45
|
+
"examples/self_test/rails/config/initializers/mime_types.rb",
|
46
|
+
"examples/self_test/rails/config/initializers/new_rails_defaults.rb",
|
47
|
+
"examples/self_test/rails/config/initializers/session_store.rb",
|
48
|
+
"examples/self_test/rails/config/locales/en.yml",
|
49
|
+
"examples/self_test/rails/config/routes.rb",
|
50
|
+
"examples/self_test/rails/db/seeds.rb",
|
51
|
+
"examples/self_test/rails/db/test.sqlite3",
|
52
|
+
"examples/self_test/rails/features/see_widgets.feature",
|
53
|
+
"examples/self_test/rails/features/step_definitions/web_steps.rb",
|
54
|
+
"examples/self_test/rails/features/support/env.rb",
|
55
|
+
"examples/self_test/rails/features/support/paths.rb",
|
56
|
+
"examples/self_test/rails/lib/tasks/cucumber.rake",
|
57
|
+
"examples/self_test/rails/public/404.html",
|
58
|
+
"examples/self_test/rails/public/422.html",
|
59
|
+
"examples/self_test/rails/public/500.html",
|
60
|
+
"examples/self_test/rails/public/favicon.ico",
|
61
|
+
"examples/self_test/rails/public/images/rails.png",
|
62
|
+
"examples/self_test/rails/public/index.html",
|
63
|
+
"examples/self_test/rails/public/javascripts/application.js",
|
64
|
+
"examples/self_test/rails/public/javascripts/controls.js",
|
65
|
+
"examples/self_test/rails/public/javascripts/dragdrop.js",
|
66
|
+
"examples/self_test/rails/public/javascripts/effects.js",
|
67
|
+
"examples/self_test/rails/public/javascripts/prototype.js",
|
68
|
+
"examples/self_test/rails/public/robots.txt",
|
69
|
+
"examples/self_test/rails/script/about",
|
70
|
+
"examples/self_test/rails/script/console",
|
71
|
+
"examples/self_test/rails/script/cucumber",
|
72
|
+
"examples/self_test/rails/script/dbconsole",
|
73
|
+
"examples/self_test/rails/script/destroy",
|
74
|
+
"examples/self_test/rails/script/generate",
|
75
|
+
"examples/self_test/rails/script/performance/benchmarker",
|
76
|
+
"examples/self_test/rails/script/performance/profiler",
|
77
|
+
"examples/self_test/rails/script/plugin",
|
78
|
+
"examples/self_test/rails/script/runner",
|
79
|
+
"examples/self_test/rails/script/server",
|
80
|
+
"examples/self_test/simple/features/call_foo.feature",
|
81
|
+
"examples/self_test/simple/features/call_foo_and_bar_together.feature",
|
82
|
+
"examples/self_test/simple/features/call_foo_from_background_then_bar.feature",
|
83
|
+
"examples/self_test/simple/features/call_foo_from_background_then_bar_then_baz.feature",
|
84
|
+
"examples/self_test/simple/features/call_foo_then_bar.feature",
|
85
|
+
"examples/self_test/simple/features/call_foo_then_bar_from_scenario_outline_examples.feature",
|
86
|
+
"examples/self_test/simple/features/fail.feature",
|
87
|
+
"examples/self_test/simple/features/step_definitions/main_steps.rb",
|
88
|
+
"examples/self_test/simple/lib/bar.rb",
|
89
|
+
"examples/self_test/simple/lib/baz.rb",
|
90
|
+
"examples/self_test/simple/lib/foo.rb",
|
91
|
+
"features/call_foo.feature",
|
92
|
+
"features/coverage_of.feature",
|
93
|
+
"features/fail.feature",
|
94
|
+
"features/help.feature",
|
95
|
+
"features/lazy_run.feature",
|
96
|
+
"features/lazy_run_per_scenario.feature",
|
97
|
+
"features/lazy_run_per_scenario_outline_example.feature",
|
98
|
+
"features/lazy_run_triggered_by_rails_view_change.feature",
|
99
|
+
"features/run.feature",
|
100
|
+
"features/show_recordings.feature",
|
101
|
+
"features/step_definitions/main_steps.rb",
|
102
|
+
"features/support/env.rb",
|
103
|
+
"lib/at_exit_hook.rb",
|
104
|
+
"lib/cucover.rb",
|
105
|
+
"lib/cucover/cli.rb",
|
106
|
+
"lib/cucover/cli_commands/coverage_of.rb",
|
107
|
+
"lib/cucover/cli_commands/cucumber.rb",
|
108
|
+
"lib/cucover/cli_commands/show_recordings.rb",
|
109
|
+
"lib/cucover/cli_commands/version.rb",
|
110
|
+
"lib/cucover/controller.rb",
|
111
|
+
"lib/cucover/cucumber_hooks.rb",
|
112
|
+
"lib/cucover/line_numbers.rb",
|
113
|
+
"lib/cucover/logging_config.rb",
|
114
|
+
"lib/cucover/monkey.rb",
|
115
|
+
"lib/cucover/rails.rb",
|
116
|
+
"lib/cucover/recorder.rb",
|
117
|
+
"lib/cucover/recording.rb",
|
118
|
+
"lib/cucover/recording/covered_file.rb",
|
119
|
+
"lib/cucover/store.rb",
|
120
|
+
"lib/dependencies.rb",
|
121
|
+
"spec/cucover/cli_spec.rb",
|
122
|
+
"spec/cucover/controller_spec.rb",
|
123
|
+
"spec/cucover/recording/covered_file_spec.rb",
|
124
|
+
"spec/cucover/store_spec.rb",
|
125
|
+
"spec/spec_helper.rb",
|
126
|
+
"tmp/.gitignore"
|
127
|
+
]
|
128
|
+
s.homepage = %q{http://github.com/mattwynne/cucover/}
|
129
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
130
|
+
s.require_paths = ["lib"]
|
131
|
+
s.rubygems_version = %q{1.3.6}
|
132
|
+
s.summary = %q{Lazy coverage-aware running of Cucumber acceptance tests}
|
133
|
+
s.test_files = [
|
134
|
+
"spec/cucover/cli_spec.rb",
|
135
|
+
"spec/cucover/controller_spec.rb",
|
136
|
+
"spec/cucover/recording/covered_file_spec.rb",
|
137
|
+
"spec/cucover/store_spec.rb",
|
138
|
+
"spec/spec_helper.rb",
|
139
|
+
"examples/self_test/rails/app/controllers/application_controller.rb",
|
140
|
+
"examples/self_test/rails/app/controllers/widgets_controller.rb",
|
141
|
+
"examples/self_test/rails/app/helpers/application_helper.rb",
|
142
|
+
"examples/self_test/rails/config/boot.rb",
|
143
|
+
"examples/self_test/rails/config/environment.rb",
|
144
|
+
"examples/self_test/rails/config/environments/cucumber.rb",
|
145
|
+
"examples/self_test/rails/config/environments/development.rb",
|
146
|
+
"examples/self_test/rails/config/environments/production.rb",
|
147
|
+
"examples/self_test/rails/config/environments/test.rb",
|
148
|
+
"examples/self_test/rails/config/initializers/backtrace_silencers.rb",
|
149
|
+
"examples/self_test/rails/config/initializers/inflections.rb",
|
150
|
+
"examples/self_test/rails/config/initializers/mime_types.rb",
|
151
|
+
"examples/self_test/rails/config/initializers/new_rails_defaults.rb",
|
152
|
+
"examples/self_test/rails/config/initializers/session_store.rb",
|
153
|
+
"examples/self_test/rails/config/routes.rb",
|
154
|
+
"examples/self_test/rails/db/seeds.rb",
|
155
|
+
"examples/self_test/rails/features/step_definitions/web_steps.rb",
|
156
|
+
"examples/self_test/rails/features/support/env.rb",
|
157
|
+
"examples/self_test/rails/features/support/paths.rb",
|
158
|
+
"examples/self_test/simple/features/step_definitions/main_steps.rb",
|
159
|
+
"examples/self_test/simple/lib/bar.rb",
|
160
|
+
"examples/self_test/simple/lib/baz.rb",
|
161
|
+
"examples/self_test/simple/lib/foo.rb"
|
162
|
+
]
|
163
|
+
|
164
|
+
if s.respond_to? :specification_version then
|
165
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
166
|
+
s.specification_version = 3
|
167
|
+
|
168
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
169
|
+
s.add_runtime_dependency(%q<cucumber>, [">= 0.3.11"])
|
170
|
+
s.add_runtime_dependency(%q<relevance-rcov>, [">= 0.8.3.4"])
|
171
|
+
s.add_runtime_dependency(%q<logging>, [">= 1.1.4"])
|
172
|
+
else
|
173
|
+
s.add_dependency(%q<cucumber>, [">= 0.3.11"])
|
174
|
+
s.add_dependency(%q<relevance-rcov>, [">= 0.8.3.4"])
|
175
|
+
s.add_dependency(%q<logging>, [">= 1.1.4"])
|
176
|
+
end
|
177
|
+
else
|
178
|
+
s.add_dependency(%q<cucumber>, [">= 0.3.11"])
|
179
|
+
s.add_dependency(%q<relevance-rcov>, [">= 0.8.3.4"])
|
180
|
+
s.add_dependency(%q<logging>, [">= 1.1.4"])
|
181
|
+
end
|
182
|
+
end
|
data/cucumber.yml
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
+
|
4
|
+
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
|
5
|
+
|
6
|
+
require 'rake'
|
7
|
+
require 'rake/testtask'
|
8
|
+
require 'rake/rdoctask'
|
9
|
+
|
10
|
+
require 'tasks/rails'
|
@@ -0,0 +1 @@
|
|
1
|
+
<p>Look at all these lovely widgets</p>
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# Don't change this file!
|
2
|
+
# Configure your app in config/environment.rb and config/environments/*.rb
|
3
|
+
|
4
|
+
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
5
|
+
|
6
|
+
module Rails
|
7
|
+
class << self
|
8
|
+
def boot!
|
9
|
+
unless booted?
|
10
|
+
preinitialize
|
11
|
+
pick_boot.run
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def booted?
|
16
|
+
defined? Rails::Initializer
|
17
|
+
end
|
18
|
+
|
19
|
+
def pick_boot
|
20
|
+
(vendor_rails? ? VendorBoot : GemBoot).new
|
21
|
+
end
|
22
|
+
|
23
|
+
def vendor_rails?
|
24
|
+
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
25
|
+
end
|
26
|
+
|
27
|
+
def preinitialize
|
28
|
+
load(preinitializer_path) if File.exist?(preinitializer_path)
|
29
|
+
end
|
30
|
+
|
31
|
+
def preinitializer_path
|
32
|
+
"#{RAILS_ROOT}/config/preinitializer.rb"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class Boot
|
37
|
+
def run
|
38
|
+
load_initializer
|
39
|
+
Rails::Initializer.run(:set_load_path)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
class VendorBoot < Boot
|
44
|
+
def load_initializer
|
45
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
46
|
+
Rails::Initializer.run(:install_gem_spec_stubs)
|
47
|
+
Rails::GemDependency.add_frozen_gem_path
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
class GemBoot < Boot
|
52
|
+
def load_initializer
|
53
|
+
self.class.load_rubygems
|
54
|
+
load_rails_gem
|
55
|
+
require 'initializer'
|
56
|
+
end
|
57
|
+
|
58
|
+
def load_rails_gem
|
59
|
+
if version = self.class.gem_version
|
60
|
+
gem 'rails', version
|
61
|
+
else
|
62
|
+
gem 'rails'
|
63
|
+
end
|
64
|
+
rescue Gem::LoadError => load_error
|
65
|
+
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
66
|
+
exit 1
|
67
|
+
end
|
68
|
+
|
69
|
+
class << self
|
70
|
+
def rubygems_version
|
71
|
+
Gem::RubyGemsVersion rescue nil
|
72
|
+
end
|
73
|
+
|
74
|
+
def gem_version
|
75
|
+
if defined? RAILS_GEM_VERSION
|
76
|
+
RAILS_GEM_VERSION
|
77
|
+
elsif ENV.include?('RAILS_GEM_VERSION')
|
78
|
+
ENV['RAILS_GEM_VERSION']
|
79
|
+
else
|
80
|
+
parse_gem_version(read_environment_rb)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def load_rubygems
|
85
|
+
min_version = '1.3.2'
|
86
|
+
require 'rubygems'
|
87
|
+
unless rubygems_version >= min_version
|
88
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
89
|
+
exit 1
|
90
|
+
end
|
91
|
+
|
92
|
+
rescue LoadError
|
93
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
94
|
+
exit 1
|
95
|
+
end
|
96
|
+
|
97
|
+
def parse_gem_version(text)
|
98
|
+
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
99
|
+
end
|
100
|
+
|
101
|
+
private
|
102
|
+
def read_environment_rb
|
103
|
+
File.read("#{RAILS_ROOT}/config/environment.rb")
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# All that for this:
|
110
|
+
Rails.boot!
|