cucumber 0.3.7 → 0.3.8
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 +21 -0
- data/Manifest.txt +6 -0
- data/bin/cucumber +1 -0
- data/examples/java/build.xml +7 -0
- data/features/html_formatter.feature +7 -0
- data/features/html_formatter/a.html +1182 -0
- data/features/step_definitions/cucumber_steps.rb +9 -1
- data/features/support/env.rb +14 -1
- data/lib/cucumber/ast/features.rb +4 -0
- data/lib/cucumber/ast/outline_table.rb +2 -2
- data/lib/cucumber/ast/scenario.rb +2 -0
- data/lib/cucumber/cli/configuration.rb +1 -0
- data/lib/cucumber/cli/main.rb +13 -8
- data/lib/cucumber/formatter/console.rb +6 -1
- data/lib/cucumber/formatter/cucumber.css +31 -12
- data/lib/cucumber/formatter/duration.rb +10 -0
- data/lib/cucumber/formatter/html.rb +28 -9
- data/lib/cucumber/formatter/pretty.rb +3 -3
- data/lib/cucumber/formatter/profile.rb +1 -1
- data/lib/cucumber/formatter/progress.rb +3 -3
- data/lib/cucumber/formatter/tag_cloud.rb +2 -2
- data/lib/cucumber/formatter/usage.rb +2 -2
- data/lib/cucumber/formatters/unicode.rb +5 -0
- data/lib/cucumber/rake/task.rb +4 -3
- data/lib/cucumber/rspec_neuter.rb +23 -0
- data/lib/cucumber/step_match.rb +2 -3
- data/lib/cucumber/version.rb +2 -1
- data/rails_generators/cucumber/cucumber_generator.rb +3 -0
- data/rails_generators/cucumber/templates/cucumber_environment.rb +21 -0
- data/rails_generators/cucumber/templates/env.rb +1 -1
- data/spec/cucumber/formatter/duration_spec.rb +22 -0
- metadata +8 -2
data/lib/cucumber/rake/task.rb
CHANGED
@@ -29,7 +29,8 @@ module Cucumber
|
|
29
29
|
attr_reader :args
|
30
30
|
|
31
31
|
def initialize(libs, cucumber_opts, feature_files)
|
32
|
-
libs
|
32
|
+
raise "libs must be an Array when running in-process" unless Array === libs
|
33
|
+
libs.reverse.each{|lib| $LOAD_PATH.unshift(lib)}
|
33
34
|
@args = (
|
34
35
|
cucumber_opts +
|
35
36
|
feature_files
|
@@ -131,7 +132,7 @@ module Cucumber
|
|
131
132
|
@rcov_opts = String === opts ? opts.split(' ') : opts
|
132
133
|
end
|
133
134
|
|
134
|
-
# Whether or not to fork a new ruby interpreter. Defaults to
|
135
|
+
# Whether or not to fork a new ruby interpreter. Defaults to true.
|
135
136
|
attr_accessor :fork
|
136
137
|
|
137
138
|
# Define what profile to be used. When used with cucumber_opts it is simply appended to it. Will be ignored when CUCUMBER_OPTS is used.
|
@@ -148,11 +149,11 @@ module Cucumber
|
|
148
149
|
# Define Cucumber Rake task
|
149
150
|
def initialize(task_name = "features", desc = "Run Features with Cucumber")
|
150
151
|
@task_name, @desc = task_name, desc
|
152
|
+
@fork = true
|
151
153
|
@libs = ['lib']
|
152
154
|
@rcov_opts = %w{--rails --exclude osx\/objc,gems\/}
|
153
155
|
|
154
156
|
yield self if block_given?
|
155
|
-
@fork = true if @rcov
|
156
157
|
|
157
158
|
@feature_pattern = "features/**/*.feature" if feature_pattern.nil? && feature_list.nil?
|
158
159
|
@step_pattern = "features/**/*.rb" if step_pattern.nil? && step_list.nil?
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
|
3
|
+
module Spec
|
4
|
+
module Runner
|
5
|
+
# Neuters RSpec's option parser.
|
6
|
+
# (RSpec's option parser tries to parse ARGV, which
|
7
|
+
# will fail when running cucumber)
|
8
|
+
class OptionParser < ::OptionParser
|
9
|
+
NEUTERED_RSPEC = Object.new
|
10
|
+
def NEUTERED_RSPEC.method_missing(m, *args); self; end
|
11
|
+
|
12
|
+
def self.method_added(m)
|
13
|
+
unless @__neutering_rspec
|
14
|
+
@__neutering_rspec = true
|
15
|
+
define_method(m) do |*a|
|
16
|
+
NEUTERED_RSPEC
|
17
|
+
end
|
18
|
+
@__neutering_rspec = false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/cucumber/step_match.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
module Cucumber
|
2
2
|
class StepMatch
|
3
|
-
attr_reader :step_definition
|
4
|
-
|
5
|
-
|
3
|
+
attr_reader :step_definition, :args, :step_name
|
4
|
+
|
6
5
|
def initialize(step_definition, step_name, formatted_step_name, args)
|
7
6
|
@step_definition, @step_name, @formatted_step_name, @args = step_definition, step_name, formatted_step_name, args
|
8
7
|
end
|
data/lib/cucumber/version.rb
CHANGED
@@ -2,9 +2,10 @@ module Cucumber #:nodoc:
|
|
2
2
|
class VERSION #:nodoc:
|
3
3
|
MAJOR = 0
|
4
4
|
MINOR = 3
|
5
|
-
TINY =
|
5
|
+
TINY = 8
|
6
6
|
PATCH = nil # Set to nil for official release
|
7
7
|
|
8
8
|
STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
|
9
|
+
STABLE_STRING = [MAJOR, MINOR, TINY].join('.')
|
9
10
|
end
|
10
11
|
end
|
@@ -11,6 +11,9 @@ class CucumberGenerator < Rails::Generator::Base
|
|
11
11
|
record do |m|
|
12
12
|
m.directory 'features/step_definitions'
|
13
13
|
m.template 'webrat_steps.rb', 'features/step_definitions/webrat_steps.rb'
|
14
|
+
m.template 'cucumber_environment.rb', 'config/environments/cucumber.rb'
|
15
|
+
m.gsub_file 'config/database.yml', /test:.*\n/, "test: &TEST\n"
|
16
|
+
m.gsub_file 'config/database.yml', /\z/, "\ncucumber:\n <<: *TEST"
|
14
17
|
|
15
18
|
m.directory 'features/support'
|
16
19
|
m.template 'env.rb', 'features/support/env.rb'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
config.cache_classes = true # This must be true for Cucumber to operate correctly!
|
2
|
+
|
3
|
+
# Log error messages when you accidentally call methods on nil.
|
4
|
+
config.whiny_nils = true
|
5
|
+
|
6
|
+
# Show full error reports and disable caching
|
7
|
+
config.action_controller.consider_all_requests_local = true
|
8
|
+
config.action_controller.perform_caching = false
|
9
|
+
|
10
|
+
# Disable request forgery protection in test environment
|
11
|
+
config.action_controller.allow_forgery_protection = false
|
12
|
+
|
13
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
14
|
+
# The :test delivery method accumulates sent emails in the
|
15
|
+
# ActionMailer::Base.deliveries array.
|
16
|
+
config.action_mailer.delivery_method = :test
|
17
|
+
|
18
|
+
config.gem "cucumber", :lib => false, :version => ">=<%= Cucumber::VERSION::STABLE_STRING %>"
|
19
|
+
config.gem "webrat", :lib => false, :version => ">=0.4.4"
|
20
|
+
config.gem "rspec", :lib => false, :version => ">=1.2.6"
|
21
|
+
config.gem "rspec-rails", :lib => 'spec/rails', :version => ">=1.2.6"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Sets up the Rails environment for Cucumber
|
2
|
-
ENV["RAILS_ENV"] ||= "
|
2
|
+
ENV["RAILS_ENV"] ||= "cucumber"
|
3
3
|
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
|
4
4
|
require 'cucumber/rails/world'
|
5
5
|
require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
require 'cucumber/formatter/duration'
|
3
|
+
|
4
|
+
module Cucumber
|
5
|
+
module Formatter
|
6
|
+
describe Duration do
|
7
|
+
include Duration
|
8
|
+
|
9
|
+
it "should format ms" do
|
10
|
+
format_duration(0.002103).should == '0m0.002s'
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should format m" do
|
14
|
+
format_duration(61.002503).should == '1m1.003s'
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should format h" do
|
18
|
+
format_duration(3661.002503).should == '61m1.003s'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
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-27 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -323,6 +323,8 @@ files:
|
|
323
323
|
- features/custom_formatter.feature
|
324
324
|
- features/exclude_files.feature
|
325
325
|
- features/expand.feature
|
326
|
+
- features/html_formatter.feature
|
327
|
+
- features/html_formatter/a.html
|
326
328
|
- features/junit_formatter.feature
|
327
329
|
- features/multiline_names.feature
|
328
330
|
- features/rake_task.feature
|
@@ -378,6 +380,7 @@ files:
|
|
378
380
|
- lib/cucumber/formatter/console.rb
|
379
381
|
- lib/cucumber/formatter/cucumber.css
|
380
382
|
- lib/cucumber/formatter/cucumber.sass
|
383
|
+
- lib/cucumber/formatter/duration.rb
|
381
384
|
- lib/cucumber/formatter/html.rb
|
382
385
|
- lib/cucumber/formatter/junit.rb
|
383
386
|
- lib/cucumber/formatter/pretty.rb
|
@@ -400,6 +403,7 @@ files:
|
|
400
403
|
- lib/cucumber/rails/rspec.rb
|
401
404
|
- lib/cucumber/rails/world.rb
|
402
405
|
- lib/cucumber/rake/task.rb
|
406
|
+
- lib/cucumber/rspec_neuter.rb
|
403
407
|
- lib/cucumber/step_definition.rb
|
404
408
|
- lib/cucumber/step_match.rb
|
405
409
|
- lib/cucumber/step_mother.rb
|
@@ -409,6 +413,7 @@ files:
|
|
409
413
|
- rails_generators/cucumber/cucumber_generator.rb
|
410
414
|
- rails_generators/cucumber/templates/cucumber
|
411
415
|
- rails_generators/cucumber/templates/cucumber.rake
|
416
|
+
- rails_generators/cucumber/templates/cucumber_environment.rb
|
412
417
|
- rails_generators/cucumber/templates/env.rb
|
413
418
|
- rails_generators/cucumber/templates/paths.rb
|
414
419
|
- rails_generators/cucumber/templates/webrat_steps.rb
|
@@ -434,6 +439,7 @@ files:
|
|
434
439
|
- spec/cucumber/core_ext/string_spec.rb
|
435
440
|
- spec/cucumber/formatter/ansicolor_spec.rb
|
436
441
|
- spec/cucumber/formatter/color_io_spec.rb
|
442
|
+
- spec/cucumber/formatter/duration_spec.rb
|
437
443
|
- spec/cucumber/formatter/html/cucumber.css
|
438
444
|
- spec/cucumber/formatter/html/cucumber.js
|
439
445
|
- spec/cucumber/formatter/html/index.html
|