aslakhellesoy-cucumber 0.3.3 → 0.3.3.1
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.
- data/History.txt +8 -1
- data/Manifest.txt +1 -0
- data/Rakefile +2 -1
- data/examples/selenium_webrat/config.ru +0 -0
- data/examples/self_test/features/background/background_tagged_before_on_outline.feature +12 -0
- data/features/cucumber_cli.feature +2 -0
- data/features/exclude_files.feature +20 -0
- data/features/step_definitions/cucumber_steps.rb +9 -0
- data/lib/cucumber/cli/configuration.rb +41 -41
- data/lib/cucumber/languages.yml +15 -0
- data/lib/cucumber/version.rb +1 -1
- data/rails_generators/cucumber/templates/webrat_steps.rb +2 -2
- data/spec/cucumber/cli/configuration_spec.rb +55 -22
- metadata +6 -3
data/History.txt
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
== 0.3.
|
|
1
|
+
== 0.3.4 (In Git)
|
|
2
|
+
|
|
3
|
+
=== New features
|
|
4
|
+
* Support for Catalan (Francesc Esplugas)
|
|
5
|
+
|
|
6
|
+
== 0.3.3 2009-05-10
|
|
7
|
+
|
|
8
|
+
Minor bugfix release, made specially for EuRuKo!
|
|
2
9
|
|
|
3
10
|
=== Bugfixes
|
|
4
11
|
* Summaries are no longer printed in an empty () if there are no scenarios/steps (Aslak Hellesøy)
|
data/Manifest.txt
CHANGED
|
@@ -235,6 +235,7 @@ features/cucumber_cli.feature
|
|
|
235
235
|
features/cucumber_cli_diff_disabled.feature
|
|
236
236
|
features/cucumber_cli_outlines.feature
|
|
237
237
|
features/custom_formatter.feature
|
|
238
|
+
features/exclude_files.feature
|
|
238
239
|
features/multiline_names.feature
|
|
239
240
|
features/rake_task.feature
|
|
240
241
|
features/report_called_undefined_steps.feature
|
data/Rakefile
CHANGED
|
@@ -5,4 +5,5 @@ require 'config/hoe' # setup Hoe + all gem configuration
|
|
|
5
5
|
Dir['gem_tasks/**/*.rake'].each { |rake| load rake }
|
|
6
6
|
|
|
7
7
|
# Hoe gives us :default => :test, but we don't have Test::Unit tests.
|
|
8
|
-
Rake::Task[:default].clear_prerequisites rescue nil # For some super weird reason this fails for some...
|
|
8
|
+
Rake::Task[:default].clear_prerequisites rescue nil # For some super weird reason this fails for some...
|
|
9
|
+
task :default => [:spec, :features]
|
|
File without changes
|
|
@@ -2,6 +2,8 @@ Feature: Cucumber command line
|
|
|
2
2
|
In order to write better software
|
|
3
3
|
Developers should be able to execute requirements as tests
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
|
|
5
7
|
Scenario: Run single scenario with missing step definition
|
|
6
8
|
When I run cucumber -q features/sample.feature:5
|
|
7
9
|
Then it should pass with
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Feature: Exclude ruby and feature files from runs
|
|
2
|
+
Developers should be able to easily exclude files from cucumber runs
|
|
3
|
+
This is a nice feature to have in conjunction with profiles, so you can exclude
|
|
4
|
+
certain environment files from certain runs.
|
|
5
|
+
|
|
6
|
+
Scenario: exclude ruby files
|
|
7
|
+
Given a standard Cucumber project directory structure
|
|
8
|
+
And a file named "features/support/dont_require_me.rb"
|
|
9
|
+
And a file named "features/step_definitions/fooz.rb"
|
|
10
|
+
And a file named "features/step_definitions/foof.rb"
|
|
11
|
+
And a file named "features/step_definitions/foot.rb"
|
|
12
|
+
And a file named "features/support/require_me.rb"
|
|
13
|
+
|
|
14
|
+
When I run cucumber features -q --verbose --exclude features/support/dont --exclude foo[zf]
|
|
15
|
+
|
|
16
|
+
Then "features/support/require_me.rb" should be required
|
|
17
|
+
And "features/step_definitions/foot.rb" should be required
|
|
18
|
+
And "features/support/dont_require_me.rb" should not be required
|
|
19
|
+
And "features/step_definitions/foof.rb" should not be required
|
|
20
|
+
And "features/step_definitions/fooz.rb" should not be required
|
|
@@ -67,3 +67,12 @@ Then /^"(.*)" should exist$/ do |file|
|
|
|
67
67
|
File.exists?(file).should be_true
|
|
68
68
|
FileUtils.rm(file)
|
|
69
69
|
end
|
|
70
|
+
|
|
71
|
+
Then /^"([^\"]*)" should not be required$/ do |file_name|
|
|
72
|
+
last_stdout.should_not include("* #{file_name}")
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
Then /^"([^\"]*)" should be required$/ do |file_name|
|
|
76
|
+
last_stdout.should include("* #{file_name}")
|
|
77
|
+
end
|
|
78
|
+
|
|
@@ -5,24 +5,24 @@ module Cucumber
|
|
|
5
5
|
class Configuration
|
|
6
6
|
FORMATS = %w{pretty profile progress rerun}
|
|
7
7
|
DEFAULT_FORMAT = 'pretty'
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
attr_reader :paths
|
|
10
10
|
attr_reader :options
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
def initialize(out_stream = STDOUT, error_stream = STDERR)
|
|
13
13
|
@out_stream = out_stream
|
|
14
14
|
@error_stream = error_stream
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
@paths = []
|
|
17
17
|
@options = default_options
|
|
18
18
|
@active_format = DEFAULT_FORMAT
|
|
19
19
|
end
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
def parse!(args)
|
|
22
22
|
@args = args
|
|
23
23
|
return parse_args_from_profile('default') if @args.empty?
|
|
24
24
|
@args.extend(::OptionParser::Arguable)
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
@args.options do |opts|
|
|
27
27
|
opts.banner = ["Usage: cucumber [options] [ [FILE|DIR|URL][:LINE[:LINE]*] ]+", "",
|
|
28
28
|
"Examples:",
|
|
@@ -30,7 +30,7 @@ module Cucumber
|
|
|
30
30
|
"cucumber --language it examples/i18n/it/features/somma.feature:6:98:113",
|
|
31
31
|
"cucumber -s -i http://rubyurl.com/eeCl", "", "",
|
|
32
32
|
].join("\n")
|
|
33
|
-
opts.on("-r LIBRARY|DIR", "--require LIBRARY|DIR",
|
|
33
|
+
opts.on("-r LIBRARY|DIR", "--require LIBRARY|DIR",
|
|
34
34
|
"Require files before executing the features. If this",
|
|
35
35
|
"option is not specified, all *.rb files that are",
|
|
36
36
|
"siblings or below the features will be loaded auto-",
|
|
@@ -42,7 +42,7 @@ module Cucumber
|
|
|
42
42
|
@options[:require] ||= []
|
|
43
43
|
@options[:require] << v
|
|
44
44
|
end
|
|
45
|
-
opts.on("-l LANG", "--language LANG",
|
|
45
|
+
opts.on("-l LANG", "--language LANG",
|
|
46
46
|
"Specify language for features (Default: #{@options[:lang]})",
|
|
47
47
|
%{Run with "--language help" to see all languages},
|
|
48
48
|
%{Run with "--language LANG help" to list keywords for LANG}) do |v|
|
|
@@ -54,24 +54,24 @@ module Cucumber
|
|
|
54
54
|
@options[:lang] = v
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
|
-
opts.on("-f FORMAT", "--format FORMAT",
|
|
57
|
+
opts.on("-f FORMAT", "--format FORMAT",
|
|
58
58
|
"How to format features (Default: #{DEFAULT_FORMAT})",
|
|
59
59
|
"Available formats: #{FORMATS.join(", ")}",
|
|
60
60
|
"You can also provide your own formatter classes as long",
|
|
61
61
|
"as they have been previously required using --require or",
|
|
62
62
|
"if they are in the folder structure such that cucumber",
|
|
63
|
-
"will require them automatically.",
|
|
63
|
+
"will require them automatically.",
|
|
64
64
|
"This option can be specified multiple times.") do |v|
|
|
65
65
|
@options[:formats][v] = @out_stream
|
|
66
66
|
@active_format = v
|
|
67
67
|
end
|
|
68
|
-
opts.on("-o", "--out FILE",
|
|
68
|
+
opts.on("-o", "--out FILE",
|
|
69
69
|
"Write output to a file instead of STDOUT. This option",
|
|
70
70
|
"applies to the previously specified --format, or the",
|
|
71
71
|
"default format if no format is specified.") do |v|
|
|
72
72
|
@options[:formats][@active_format] = v
|
|
73
73
|
end
|
|
74
|
-
opts.on("-t TAGS", "--tags TAGS",
|
|
74
|
+
opts.on("-t TAGS", "--tags TAGS",
|
|
75
75
|
"Only execute the features or scenarios with the specified tags.",
|
|
76
76
|
"TAGS must be comma-separated without spaces. Prefix tags with ~ to",
|
|
77
77
|
"exclude features or scenarios having that tag. Tags can be specified",
|
|
@@ -84,8 +84,8 @@ module Cucumber
|
|
|
84
84
|
"given names.") do |v|
|
|
85
85
|
@options[:name_regexps] << /#{v}/
|
|
86
86
|
end
|
|
87
|
-
opts.on("-e", "--exclude PATTERN", "Don't run feature files matching PATTERN") do |v|
|
|
88
|
-
@options[:excludes] << v
|
|
87
|
+
opts.on("-e", "--exclude PATTERN", "Don't run feature files or require ruby files matching PATTERN") do |v|
|
|
88
|
+
@options[:excludes] << Regexp.new(v)
|
|
89
89
|
end
|
|
90
90
|
opts.on("-p", "--profile PROFILE", "Pull commandline arguments from cucumber.yml.") do |v|
|
|
91
91
|
parse_args_from_profile(v)
|
|
@@ -101,7 +101,7 @@ module Cucumber
|
|
|
101
101
|
@options[:dry_run] = true
|
|
102
102
|
@quiet = true
|
|
103
103
|
end
|
|
104
|
-
opts.on("-a", "--autoformat DIRECTORY",
|
|
104
|
+
opts.on("-a", "--autoformat DIRECTORY",
|
|
105
105
|
"Reformats (pretty prints) feature files and write them to DIRECTORY.",
|
|
106
106
|
"Be careful if you choose to overwrite the originals.",
|
|
107
107
|
"Implies --dry-run --formatter pretty.") do |directory|
|
|
@@ -110,11 +110,11 @@ module Cucumber
|
|
|
110
110
|
@options[:dry_run] = true
|
|
111
111
|
@quiet = true
|
|
112
112
|
end
|
|
113
|
-
opts.on("-m", "--no-multiline",
|
|
113
|
+
opts.on("-m", "--no-multiline",
|
|
114
114
|
"Don't print multiline strings and tables under steps.") do
|
|
115
115
|
@options[:no_multiline] = true
|
|
116
116
|
end
|
|
117
|
-
opts.on("-s", "--no-source",
|
|
117
|
+
opts.on("-s", "--no-source",
|
|
118
118
|
"Don't print the file and line of the step definition with the steps.") do
|
|
119
119
|
@options[:source] = false
|
|
120
120
|
end
|
|
@@ -157,19 +157,19 @@ module Cucumber
|
|
|
157
157
|
# Whatever is left after option parsing is the FILE arguments
|
|
158
158
|
@paths += args
|
|
159
159
|
end
|
|
160
|
-
|
|
160
|
+
|
|
161
161
|
def verbose?
|
|
162
162
|
@options[:verbose]
|
|
163
163
|
end
|
|
164
|
-
|
|
164
|
+
|
|
165
165
|
def strict?
|
|
166
166
|
@options[:strict]
|
|
167
167
|
end
|
|
168
|
-
|
|
168
|
+
|
|
169
169
|
def guess?
|
|
170
170
|
@options[:guess]
|
|
171
171
|
end
|
|
172
|
-
|
|
172
|
+
|
|
173
173
|
def diff_enabled?
|
|
174
174
|
@options[:diff_enabled]
|
|
175
175
|
end
|
|
@@ -203,7 +203,7 @@ module Cucumber
|
|
|
203
203
|
out.close
|
|
204
204
|
end
|
|
205
205
|
end
|
|
206
|
-
|
|
206
|
+
|
|
207
207
|
begin
|
|
208
208
|
formatter_class = formatter_class(format)
|
|
209
209
|
formatter_class.new(step_mother, out, @options)
|
|
@@ -211,12 +211,12 @@ module Cucumber
|
|
|
211
211
|
exit_with_error("Error creating formatter: #{format}", e)
|
|
212
212
|
end
|
|
213
213
|
end
|
|
214
|
-
|
|
214
|
+
|
|
215
215
|
broadcaster = Broadcaster.new(formatters)
|
|
216
216
|
broadcaster.options = @options
|
|
217
217
|
return broadcaster
|
|
218
218
|
end
|
|
219
|
-
|
|
219
|
+
|
|
220
220
|
def formatter_class(format)
|
|
221
221
|
case format
|
|
222
222
|
when 'html' then Formatter::Html
|
|
@@ -229,7 +229,7 @@ module Cucumber
|
|
|
229
229
|
constantize(format)
|
|
230
230
|
end
|
|
231
231
|
end
|
|
232
|
-
|
|
232
|
+
|
|
233
233
|
def files_to_require
|
|
234
234
|
requires = @options[:require] || feature_dirs
|
|
235
235
|
files = requires.map do |path|
|
|
@@ -239,32 +239,32 @@ module Cucumber
|
|
|
239
239
|
sorted_files = files.sort { |a,b| (b =~ %r{/support/} || -1) <=> (a =~ %r{/support/} || -1) }.reject{|f| f =~ /^http/}
|
|
240
240
|
env_files = sorted_files.select {|f| f =~ %r{/support/env.rb} }
|
|
241
241
|
files = env_files + sorted_files.reject {|f| f =~ %r{/support/env.rb} }
|
|
242
|
+
remove_excluded_files_from(files)
|
|
242
243
|
files.reject! {|f| f =~ %r{/support/env.rb} } if @options[:dry_run]
|
|
243
244
|
files
|
|
244
245
|
end
|
|
245
|
-
|
|
246
|
+
|
|
247
|
+
|
|
246
248
|
def feature_files
|
|
247
249
|
potential_feature_files = @paths.map do |path|
|
|
248
250
|
path = path.gsub(/\\/, '/') # In case we're on windows. Globs don't work with backslashes.
|
|
249
251
|
path = path.chomp('/')
|
|
250
252
|
File.directory?(path) ? Dir["#{path}/**/*.feature"] : path
|
|
251
253
|
end.flatten.uniq
|
|
252
|
-
|
|
253
|
-
@options[:excludes].each do |exclude|
|
|
254
|
-
potential_feature_files.reject! do |path|
|
|
255
|
-
path =~ /#{Regexp.escape(exclude)}/
|
|
256
|
-
end
|
|
257
|
-
end
|
|
258
|
-
|
|
254
|
+
remove_excluded_files_from(potential_feature_files)
|
|
259
255
|
potential_feature_files
|
|
260
256
|
end
|
|
261
257
|
|
|
262
258
|
protected
|
|
263
|
-
|
|
259
|
+
|
|
260
|
+
def remove_excluded_files_from(files)
|
|
261
|
+
files.reject! {|path| @options[:excludes].detect {|pattern| path =~ pattern } }
|
|
262
|
+
end
|
|
263
|
+
|
|
264
264
|
def feature_dirs
|
|
265
265
|
@paths.map { |f| File.directory?(f) ? f : File.dirname(f) }.uniq
|
|
266
266
|
end
|
|
267
|
-
|
|
267
|
+
|
|
268
268
|
def constantize(camel_cased_word)
|
|
269
269
|
names = camel_cased_word.split('::')
|
|
270
270
|
names.shift if names.empty? || names.first.empty?
|
|
@@ -275,7 +275,7 @@ module Cucumber
|
|
|
275
275
|
end
|
|
276
276
|
constant
|
|
277
277
|
end
|
|
278
|
-
|
|
278
|
+
|
|
279
279
|
def parse_args_from_profile(profile)
|
|
280
280
|
unless cucumber_yml.has_key?(profile)
|
|
281
281
|
return(exit_with_error <<-END_OF_ERROR)
|
|
@@ -299,7 +299,7 @@ Defined profiles in cucumber.yml:
|
|
|
299
299
|
rescue YmlLoadError => e
|
|
300
300
|
exit_with_error(e.message)
|
|
301
301
|
end
|
|
302
|
-
|
|
302
|
+
|
|
303
303
|
def cucumber_yml
|
|
304
304
|
return @cucumber_yml if @cucumber_yml
|
|
305
305
|
unless File.exist?('cucumber.yml')
|
|
@@ -319,7 +319,7 @@ Defined profiles in cucumber.yml:
|
|
|
319
319
|
|
|
320
320
|
return @cucumber_yml
|
|
321
321
|
end
|
|
322
|
-
|
|
322
|
+
|
|
323
323
|
def list_keywords_and_exit(lang)
|
|
324
324
|
unless Cucumber::LANGUAGES[lang]
|
|
325
325
|
exit_with_error("No language with key #{lang}")
|
|
@@ -327,12 +327,12 @@ Defined profiles in cucumber.yml:
|
|
|
327
327
|
LanguageHelpFormatter.list_keywords(@out_stream, lang)
|
|
328
328
|
Kernel.exit
|
|
329
329
|
end
|
|
330
|
-
|
|
330
|
+
|
|
331
331
|
def list_languages
|
|
332
332
|
LanguageHelpFormatter.list_languages(@out_stream)
|
|
333
333
|
Kernel.exit
|
|
334
334
|
end
|
|
335
|
-
|
|
335
|
+
|
|
336
336
|
def default_options
|
|
337
337
|
{
|
|
338
338
|
:strict => false,
|
|
@@ -347,7 +347,7 @@ Defined profiles in cucumber.yml:
|
|
|
347
347
|
:diff_enabled => true
|
|
348
348
|
}
|
|
349
349
|
end
|
|
350
|
-
|
|
350
|
+
|
|
351
351
|
def exit_with_error(error_message, e=nil)
|
|
352
352
|
@error_stream.puts(error_message)
|
|
353
353
|
if e
|
|
@@ -357,6 +357,6 @@ Defined profiles in cucumber.yml:
|
|
|
357
357
|
Kernel.exit 1
|
|
358
358
|
end
|
|
359
359
|
end
|
|
360
|
-
|
|
360
|
+
|
|
361
361
|
end
|
|
362
362
|
end
|
data/lib/cucumber/languages.yml
CHANGED
|
@@ -161,6 +161,21 @@
|
|
|
161
161
|
and: Y
|
|
162
162
|
but: Pero
|
|
163
163
|
space_after_keyword: true
|
|
164
|
+
"cat":
|
|
165
|
+
name: Catalan
|
|
166
|
+
native: català
|
|
167
|
+
encoding: UTF-8
|
|
168
|
+
background: Rerefons
|
|
169
|
+
feature: Característica
|
|
170
|
+
scenario: Escenari
|
|
171
|
+
scenario_outline: Esquema de l'escenari
|
|
172
|
+
examples: Exemples
|
|
173
|
+
given: Donat
|
|
174
|
+
when: Quan
|
|
175
|
+
then: aleshores
|
|
176
|
+
and: i
|
|
177
|
+
but: Però
|
|
178
|
+
space_after_keyword: true
|
|
164
179
|
"et":
|
|
165
180
|
name: Estonian
|
|
166
181
|
native: eesti keel
|
data/lib/cucumber/version.rb
CHANGED
|
@@ -40,8 +40,8 @@ end
|
|
|
40
40
|
# <%%= f.label :alternative %><br />
|
|
41
41
|
# <%%= f.datetime_select :alternative %>
|
|
42
42
|
# The following steps would fill out the form:
|
|
43
|
-
# When I select "November 23, 2004 11:20" as the "Preferred"
|
|
44
|
-
# And I select "November 25, 2004 10:30" as the "Alternative"
|
|
43
|
+
# When I select "November 23, 2004 11:20" as the "Preferred" date and time
|
|
44
|
+
# And I select "November 25, 2004 10:30" as the "Alternative" date and time
|
|
45
45
|
When /^I select "([^\"]*)" as the "([^\"]*)" date and time$/ do |datetime, datetime_label|
|
|
46
46
|
select_datetime(datetime, :from => datetime_label)
|
|
47
47
|
end
|
|
@@ -4,20 +4,24 @@ require 'yaml'
|
|
|
4
4
|
module Cucumber
|
|
5
5
|
module Cli
|
|
6
6
|
describe Configuration do
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
def given_cucumber_yml_defined_as(hash_or_string)
|
|
9
9
|
File.stub!(:exist?).and_return(true)
|
|
10
10
|
cucumber_yml = hash_or_string.is_a?(Hash) ? hash_or_string.to_yaml : hash_or_string
|
|
11
11
|
IO.stub!(:read).with('cucumber.yml').and_return(cucumber_yml)
|
|
12
12
|
end
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
def given_the_following_files(*files)
|
|
15
|
+
File.stub!(:directory?).and_return(true)
|
|
16
|
+
Dir.stub!(:[]).and_return(files)
|
|
17
|
+
end
|
|
18
|
+
|
|
14
19
|
before(:each) do
|
|
15
20
|
Kernel.stub!(:exit).and_return(nil)
|
|
16
21
|
end
|
|
17
22
|
|
|
18
23
|
it "should require files in support paths first" do
|
|
19
|
-
|
|
20
|
-
Dir.stub!(:[]).and_return(["/features/step_definitions/foo.rb","/features/support/bar.rb"])
|
|
24
|
+
given_the_following_files("/features/step_definitions/foo.rb","/features/support/bar.rb")
|
|
21
25
|
|
|
22
26
|
config = Configuration.new(StringIO.new)
|
|
23
27
|
config.parse!(%w{--require /features})
|
|
@@ -29,8 +33,7 @@ module Cli
|
|
|
29
33
|
end
|
|
30
34
|
|
|
31
35
|
it "should require env.rb files first" do
|
|
32
|
-
|
|
33
|
-
Dir.stub!(:[]).and_return(["/features/support/a_file.rb","/features/support/env.rb"])
|
|
36
|
+
given_the_following_files("/features/support/a_file.rb","/features/support/env.rb")
|
|
34
37
|
|
|
35
38
|
config = Configuration.new(StringIO.new)
|
|
36
39
|
config.parse!(%w{--require /features})
|
|
@@ -42,8 +45,7 @@ module Cli
|
|
|
42
45
|
end
|
|
43
46
|
|
|
44
47
|
it "should not require env.rb files when --dry-run" do
|
|
45
|
-
|
|
46
|
-
Dir.stub!(:[]).and_return(["/features/support/a_file.rb","/features/support/env.rb"])
|
|
48
|
+
given_the_following_files("/features/support/a_file.rb","/features/support/env.rb")
|
|
47
49
|
|
|
48
50
|
config = Configuration.new(StringIO.new)
|
|
49
51
|
config.parse!(%w{--require /features --dry-run})
|
|
@@ -53,6 +55,37 @@ module Cli
|
|
|
53
55
|
]
|
|
54
56
|
end
|
|
55
57
|
|
|
58
|
+
describe "--exclude" do
|
|
59
|
+
|
|
60
|
+
it "excludes a ruby file from requiring when the name matches exactly" do
|
|
61
|
+
given_the_following_files("/features/support/a_file.rb","/features/support/env.rb")
|
|
62
|
+
|
|
63
|
+
config = Configuration.new(StringIO.new)
|
|
64
|
+
config.parse!(%w{--require /features --exclude a_file.rb})
|
|
65
|
+
|
|
66
|
+
config.files_to_require.should == [
|
|
67
|
+
"/features/support/env.rb"
|
|
68
|
+
]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
it "excludes all ruby files that match the provided patterns from requiring" do
|
|
72
|
+
given_the_following_files("/features/support/foof.rb","/features/support/bar.rb",
|
|
73
|
+
"/features/support/food.rb","/features/blah.rb",
|
|
74
|
+
"/features/support/fooz.rb")
|
|
75
|
+
|
|
76
|
+
config = Configuration.new(StringIO.new)
|
|
77
|
+
config.parse!(%w{--require /features --exclude foo[df] --exclude blah})
|
|
78
|
+
|
|
79
|
+
config.files_to_require.should == [
|
|
80
|
+
"/features/support/bar.rb",
|
|
81
|
+
"/features/support/fooz.rb"
|
|
82
|
+
]
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
|
|
56
89
|
it "should expand args from YAML file" do
|
|
57
90
|
given_cucumber_yml_defined_as({'bongo' => '--require from/yml'})
|
|
58
91
|
|
|
@@ -121,7 +154,7 @@ END_OF_MESSAGE
|
|
|
121
154
|
|
|
122
155
|
['', 'sfsadfs', "--- \n- an\n- array\n", "---dddfd"].each do |bad_input|
|
|
123
156
|
given_cucumber_yml_defined_as(bad_input)
|
|
124
|
-
|
|
157
|
+
|
|
125
158
|
config = Configuration.new(StringIO.new, error = StringIO.new)
|
|
126
159
|
config.parse!([])
|
|
127
160
|
|
|
@@ -194,13 +227,13 @@ END_OF_MESSAGE
|
|
|
194
227
|
config.options[:formats].should have_key('pretty')
|
|
195
228
|
config.options[:formats].should have_key('progress')
|
|
196
229
|
end
|
|
197
|
-
|
|
230
|
+
|
|
198
231
|
it "should associate --out to previous --format" do
|
|
199
232
|
config = Configuration.new(StringIO.new)
|
|
200
233
|
config.parse!(%w{--format progress --out file1 --format profile --out file2})
|
|
201
234
|
config.options[:formats].should == {"profile"=>"file2", "progress"=>"file1"}
|
|
202
235
|
end
|
|
203
|
-
|
|
236
|
+
|
|
204
237
|
it "should accept --color option" do
|
|
205
238
|
Term::ANSIColor.should_receive(:coloring=).with(true)
|
|
206
239
|
config = Configuration.new(StringIO.new)
|
|
@@ -212,19 +245,19 @@ END_OF_MESSAGE
|
|
|
212
245
|
config = Configuration.new(StringIO.new)
|
|
213
246
|
config.parse!(['--no-color'])
|
|
214
247
|
end
|
|
215
|
-
|
|
248
|
+
|
|
216
249
|
it "should parse tags" do
|
|
217
250
|
config = Configuration.new(nil)
|
|
218
251
|
includes, excludes = config.parse_tags("one,~two,@three,~@four")
|
|
219
252
|
includes.should == ['one', 'three']
|
|
220
253
|
excludes.should == ['two', 'four']
|
|
221
254
|
end
|
|
222
|
-
|
|
255
|
+
|
|
223
256
|
describe "--backtrace" do
|
|
224
257
|
before do
|
|
225
258
|
Exception.cucumber_full_backtrace = false
|
|
226
259
|
end
|
|
227
|
-
|
|
260
|
+
|
|
228
261
|
it "should show full backtrace when --backtrace is present" do
|
|
229
262
|
config = Main.new(['--backtrace'])
|
|
230
263
|
begin
|
|
@@ -238,31 +271,31 @@ END_OF_MESSAGE
|
|
|
238
271
|
Exception.cucumber_full_backtrace = false
|
|
239
272
|
end
|
|
240
273
|
end
|
|
241
|
-
|
|
274
|
+
|
|
242
275
|
describe "diff output" do
|
|
243
276
|
|
|
244
277
|
it "is enabled by default" do
|
|
245
278
|
config = Configuration.new
|
|
246
279
|
config.diff_enabled?.should be_true
|
|
247
280
|
end
|
|
248
|
-
|
|
281
|
+
|
|
249
282
|
it "is disabled when the --no-diff option is supplied" do
|
|
250
283
|
config = Configuration.new
|
|
251
284
|
config.parse!(%w{--no-diff})
|
|
252
285
|
|
|
253
286
|
config.diff_enabled?.should be_false
|
|
254
287
|
end
|
|
255
|
-
|
|
288
|
+
|
|
256
289
|
end
|
|
257
290
|
|
|
258
291
|
it "should accept multiple --name options" do
|
|
259
292
|
config = Configuration.new
|
|
260
293
|
config.parse!(['--name', "User logs in", '--name', "User signs up"])
|
|
261
|
-
|
|
294
|
+
|
|
262
295
|
config.options[:name_regexps].should include(/User logs in/)
|
|
263
296
|
config.options[:name_regexps].should include(/User signs up/)
|
|
264
297
|
end
|
|
265
|
-
|
|
298
|
+
|
|
266
299
|
it "should accept multiple -n options" do
|
|
267
300
|
config = Configuration.new
|
|
268
301
|
config.parse!(['-n', "User logs in", '-n', "User signs up"])
|
|
@@ -275,13 +308,13 @@ END_OF_MESSAGE
|
|
|
275
308
|
File.stub!(:directory?).and_return(true)
|
|
276
309
|
Dir.should_receive(:[]).with("feature_directory/**/*.feature").
|
|
277
310
|
any_number_of_times.and_return(["cucumber.feature"])
|
|
278
|
-
|
|
311
|
+
|
|
279
312
|
config = Configuration.new(StringIO)
|
|
280
313
|
config.parse!(%w{feature_directory/})
|
|
281
|
-
|
|
314
|
+
|
|
282
315
|
config.feature_files.should == ["cucumber.feature"]
|
|
283
316
|
end
|
|
284
|
-
|
|
317
|
+
|
|
285
318
|
end
|
|
286
319
|
end
|
|
287
320
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aslakhellesoy-cucumber
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.3
|
|
4
|
+
version: 0.3.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- "Aslak Helles\xC3\xB8y"
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-05-
|
|
12
|
+
date: 2009-05-10 00:00:00 -07:00
|
|
13
13
|
default_executable: cucumber
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
@@ -235,11 +235,13 @@ files:
|
|
|
235
235
|
- examples/selenium/features/step_definitons/search_steps.rb
|
|
236
236
|
- examples/selenium/features/support/env.rb
|
|
237
237
|
- examples/selenium_webrat/Rakefile
|
|
238
|
+
- examples/selenium_webrat/config.ru
|
|
238
239
|
- examples/selenium_webrat/features/search.feature
|
|
239
240
|
- examples/selenium_webrat/features/step_definitons/search_steps.rb
|
|
240
241
|
- examples/selenium_webrat/features/support/env.rb
|
|
241
242
|
- examples/self_test/README.textile
|
|
242
243
|
- examples/self_test/Rakefile
|
|
244
|
+
- examples/self_test/features/background/background_tagged_before_on_outline.feature
|
|
243
245
|
- examples/self_test/features/background/background_with_name.feature
|
|
244
246
|
- examples/self_test/features/background/failing_background.feature
|
|
245
247
|
- examples/self_test/features/background/failing_background_after_success.feature
|
|
@@ -310,6 +312,7 @@ files:
|
|
|
310
312
|
- features/cucumber_cli_diff_disabled.feature
|
|
311
313
|
- features/cucumber_cli_outlines.feature
|
|
312
314
|
- features/custom_formatter.feature
|
|
315
|
+
- features/exclude_files.feature
|
|
313
316
|
- features/multiline_names.feature
|
|
314
317
|
- features/rake_task.feature
|
|
315
318
|
- features/report_called_undefined_steps.feature
|
|
@@ -473,7 +476,7 @@ requirements: []
|
|
|
473
476
|
rubyforge_project: rspec
|
|
474
477
|
rubygems_version: 1.2.0
|
|
475
478
|
signing_key:
|
|
476
|
-
specification_version:
|
|
479
|
+
specification_version: 2
|
|
477
480
|
summary: Executable Feature scenarios
|
|
478
481
|
test_files: []
|
|
479
482
|
|