kosmas58-cucumber 0.1.99.21 → 0.1.99.22
Sign up to get free protection for your applications and to get access to all the features.
- metadata +17 -300
- data/History.txt +0 -513
- data/License.txt +0 -20
- data/Manifest.txt +0 -0
- data/README.txt +0 -4
- data/Rakefile +0 -9
- data/bin/cucumber +0 -6
- data/config/hoe.rb +0 -75
- data/config/requirements.rb +0 -15
- data/cucumber.yml +0 -3
- data/examples/cs/README.textile +0 -1
- data/examples/cs/Rakefile +0 -12
- data/examples/cs/compile.bat +0 -1
- data/examples/cs/features/addition.feature +0 -16
- data/examples/cs/features/step_definitons/calculator_steps.rb +0 -19
- data/examples/cs/src/demo/Calculator.cs +0 -20
- data/examples/dos_line_endings/Rakefile +0 -6
- data/examples/dos_line_endings/features/dos_line_endings.feature +0 -9
- data/examples/i18n/README.textile +0 -18
- data/examples/i18n/Rakefile +0 -32
- data/examples/i18n/ar/Rakefile +0 -6
- data/examples/i18n/ar/features/addition.feature +0 -17
- data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +0 -28
- data/examples/i18n/ar/lib/calculator.rb +0 -10
- data/examples/i18n/da/Rakefile +0 -6
- data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +0 -24
- data/examples/i18n/da/features/summering.feature +0 -17
- data/examples/i18n/da/lib/kalkulator.rb +0 -11
- data/examples/i18n/de/Rakefile +0 -6
- data/examples/i18n/de/features/addition.feature +0 -16
- data/examples/i18n/de/features/division.feature +0 -9
- data/examples/i18n/de/features/step_definitons/calculator_steps.rb +0 -24
- data/examples/i18n/de/lib/calculator.rb +0 -14
- data/examples/i18n/en/Rakefile +0 -6
- data/examples/i18n/en/features/addition.feature +0 -16
- data/examples/i18n/en/features/division.feature +0 -9
- data/examples/i18n/en/features/step_definitons/calculator_steps.rb +0 -24
- data/examples/i18n/en/lib/calculator.rb +0 -14
- data/examples/i18n/es/Rakefile +0 -6
- data/examples/i18n/es/features/adicion.feature +0 -16
- data/examples/i18n/es/features/step_definitons/calculador_steps.rb +0 -21
- data/examples/i18n/es/lib/calculador.rb +0 -14
- data/examples/i18n/et/Rakefile +0 -6
- data/examples/i18n/et/features/liitmine.feature +0 -17
- data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +0 -24
- data/examples/i18n/et/lib/kalkulaator.rb +0 -10
- data/examples/i18n/fi/Rakefile +0 -6
- data/examples/i18n/fi/features/jakolasku.feature +0 -9
- data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +0 -24
- data/examples/i18n/fi/features/yhteenlasku.feature +0 -16
- data/examples/i18n/fi/lib/laskin.rb +0 -14
- data/examples/i18n/fr/Rakefile +0 -6
- data/examples/i18n/fr/features/addition.feature +0 -15
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +0 -27
- data/examples/i18n/fr/lib/calculatrice.rb +0 -10
- data/examples/i18n/id/Rakefile +0 -6
- data/examples/i18n/id/features/addition.feature +0 -16
- data/examples/i18n/id/features/division.feature +0 -9
- data/examples/i18n/id/features/step_definitons/calculator_steps.rb +0 -24
- data/examples/i18n/id/lib/calculator.rb +0 -14
- data/examples/i18n/it/Rakefile +0 -6
- data/examples/i18n/it/features/somma.feature +0 -10
- data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +0 -24
- data/examples/i18n/it/lib/calcolatrice.rb +0 -11
- data/examples/i18n/ja/README.txt +0 -5
- data/examples/i18n/ja/Rakefile +0 -6
- data/examples/i18n/ja/features/addition.feature +0 -16
- data/examples/i18n/ja/features/division.feature +0 -9
- data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +0 -24
- data/examples/i18n/ja/lib/calculator.rb +0 -14
- data/examples/i18n/ko/Rakefile +0 -6
- data/examples/i18n/ko/features/addition.feature +0 -16
- data/examples/i18n/ko/features/division.feature +0 -10
- data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +0 -24
- data/examples/i18n/ko/lib/calculator.rb +0 -14
- data/examples/i18n/lt/Rakefile +0 -6
- data/examples/i18n/lt/features/addition.feature +0 -17
- data/examples/i18n/lt/features/division.feature +0 -9
- data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +0 -24
- data/examples/i18n/lt/lib/calculator.rb +0 -14
- data/examples/i18n/no/Rakefile +0 -6
- data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +0 -24
- data/examples/i18n/no/features/summering.feature +0 -18
- data/examples/i18n/no/lib/kalkulator.rb +0 -11
- data/examples/i18n/pt/Rakefile +0 -6
- data/examples/i18n/pt/features/adicao.feature +0 -10
- data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +0 -24
- data/examples/i18n/pt/lib/calculadora.rb +0 -10
- data/examples/i18n/ro/Rakefile +0 -6
- data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +0 -24
- data/examples/i18n/ro/features/suma.feature +0 -10
- data/examples/i18n/ro/lib/calculator.rb +0 -11
- data/examples/i18n/se/Rakefile +0 -6
- data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +0 -24
- data/examples/i18n/se/features/summering.feature +0 -17
- data/examples/i18n/se/lib/kalkulator.rb +0 -11
- data/examples/i18n/zh-CN/Rakefile +0 -6
- data/examples/i18n/zh-CN/features/addition.feature +0 -17
- data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +0 -26
- data/examples/i18n/zh-CN/lib/calculator.rb +0 -10
- data/examples/java/README.textile +0 -22
- data/examples/java/Rakefile +0 -12
- data/examples/java/features/hello.feature +0 -11
- data/examples/java/features/step_definitons/hello_steps.rb +0 -25
- data/examples/java/features/step_definitons/tree_steps.rb +0 -14
- data/examples/java/features/tree.feature +0 -9
- data/examples/java/src/cucumber/demo/Hello.java +0 -16
- data/examples/jbehave/README.textile +0 -17
- data/examples/jbehave/features/support/env.rb +0 -7
- data/examples/jbehave/features/trading.feature +0 -24
- data/examples/jbehave/pom.xml +0 -48
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/converters/TraderConverter.java +0 -32
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/model/Stock.java +0 -42
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/model/Trader.java +0 -29
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/persistence/TraderPersister.java +0 -22
- data/examples/jbehave/src/main/java/cukes/jbehave/examples/trader/scenarios/TraderSteps.java +0 -65
- data/examples/selenium/Rakefile +0 -6
- data/examples/selenium/features/search.feature +0 -9
- data/examples/selenium/features/step_definitons/stories_steps.rb +0 -40
- data/examples/self_test/README.textile +0 -6
- data/examples/self_test/Rakefile +0 -6
- data/examples/self_test/features/background/failing_background.feature +0 -10
- data/examples/self_test/features/background/failing_background_after_success.feature +0 -11
- data/examples/self_test/features/background/multiline_args_background.feature +0 -32
- data/examples/self_test/features/background/passing_background.feature +0 -10
- data/examples/self_test/features/background/pending_background.feature +0 -10
- data/examples/self_test/features/background/scenario_outline_failing_background.feature +0 -16
- data/examples/self_test/features/background/scenario_outline_passing_background.feature +0 -16
- data/examples/self_test/features/call_undefined_step_from_step_def.feature +0 -7
- data/examples/self_test/features/lots_of_undefined.feature +0 -8
- data/examples/self_test/features/outline_sample.feature +0 -15
- data/examples/self_test/features/sample.feature +0 -19
- data/examples/self_test/features/step_definitions/sample_steps.rb +0 -62
- data/examples/self_test/features/support/env.rb +0 -1
- data/examples/self_test/features/support/tag_count_formatter.rb +0 -25
- data/examples/test_unit/Rakefile +0 -6
- data/examples/test_unit/features/step_definitions/test_unit_steps.rb +0 -26
- data/examples/test_unit/features/test_unit.feature +0 -9
- data/examples/tickets/Rakefile +0 -11
- data/examples/tickets/cucumber.yml +0 -2
- data/examples/tickets/features/172.feature +0 -28
- data/examples/tickets/features/177/1.feature +0 -29
- data/examples/tickets/features/177/2.feature +0 -21
- data/examples/tickets/features/177/3.feature +0 -18
- data/examples/tickets/features/180.feature +0 -7
- data/examples/tickets/features/lib/eatting_machine.rb +0 -18
- data/examples/tickets/features/lib/pantry.rb +0 -20
- data/examples/tickets/features/scenario_outline.feature +0 -95
- data/examples/tickets/features/step_definitons/scenario_outline_steps.rb +0 -42
- data/examples/tickets/features/step_definitons/tickets_steps.rb +0 -60
- data/examples/tickets/features/tickets.feature +0 -28
- data/examples/watir/README.textile +0 -16
- data/examples/watir/Rakefile +0 -6
- data/examples/watir/features/search.feature +0 -9
- data/examples/watir/features/step_definitons/search_steps.rb +0 -24
- data/examples/watir/features/support/env.rb +0 -32
- data/features/background.feature +0 -223
- data/features/cucumber_cli.feature +0 -343
- data/features/cucumber_cli_outlines.feature +0 -90
- data/features/custom_formatter.feature +0 -11
- data/features/report_called_undefined_steps.feature +0 -32
- data/features/step_definitions/cucumber_steps.rb +0 -31
- data/features/step_definitions/extra_steps.rb +0 -2
- data/features/support/env.rb +0 -8
- data/gem_tasks/deployment.rake +0 -11
- data/gem_tasks/environment.rake +0 -7
- data/gem_tasks/features.rake +0 -9
- data/gem_tasks/fix_cr_lf.rake +0 -10
- data/gem_tasks/flog.rake +0 -4
- data/gem_tasks/gemspec.rake +0 -10
- data/gem_tasks/jar.rake +0 -67
- data/gem_tasks/rspec.rake +0 -38
- data/gem_tasks/yard.rake +0 -8
- data/lib/autotest/cucumber.rb +0 -6
- data/lib/autotest/cucumber_mixin.rb +0 -124
- data/lib/autotest/cucumber_rails.rb +0 -6
- data/lib/autotest/cucumber_rails_rspec.rb +0 -6
- data/lib/autotest/cucumber_rspec.rb +0 -6
- data/lib/autotest/discover.rb +0 -9
- data/lib/cucumber/ast/background.rb +0 -88
- data/lib/cucumber/ast/comment.rb +0 -26
- data/lib/cucumber/ast/examples.rb +0 -26
- data/lib/cucumber/ast/feature.rb +0 -66
- data/lib/cucumber/ast/features.rb +0 -39
- data/lib/cucumber/ast/filter.rb +0 -22
- data/lib/cucumber/ast/outline_table.rb +0 -49
- data/lib/cucumber/ast/py_string.rb +0 -52
- data/lib/cucumber/ast/scenario.rb +0 -103
- data/lib/cucumber/ast/scenario_outline.rb +0 -92
- data/lib/cucumber/ast/step.rb +0 -161
- data/lib/cucumber/ast/steps.rb +0 -13
- data/lib/cucumber/ast/table.rb +0 -218
- data/lib/cucumber/ast/tags.rb +0 -40
- data/lib/cucumber/ast/visitor.rb +0 -109
- data/lib/cucumber/ast.rb +0 -29
- data/lib/cucumber/broadcaster.rb +0 -15
- data/lib/cucumber/cli/configuration.rb +0 -339
- data/lib/cucumber/cli/language_help_formatter.rb +0 -59
- data/lib/cucumber/cli/main.rb +0 -100
- data/lib/cucumber/core_ext/exception.rb +0 -53
- data/lib/cucumber/core_ext/instance_exec.rb +0 -54
- data/lib/cucumber/core_ext/proc.rb +0 -33
- data/lib/cucumber/core_ext/string.rb +0 -48
- data/lib/cucumber/formatter/ansicolor.rb +0 -103
- data/lib/cucumber/formatter/color_io.rb +0 -17
- data/lib/cucumber/formatter/console.rb +0 -119
- data/lib/cucumber/formatter/cucumber.css +0 -55
- data/lib/cucumber/formatter/cucumber.sass +0 -49
- data/lib/cucumber/formatter/html.rb +0 -121
- data/lib/cucumber/formatter/pretty.rb +0 -167
- data/lib/cucumber/formatter/profile.rb +0 -77
- data/lib/cucumber/formatter/progress.rb +0 -68
- data/lib/cucumber/formatter/rerun.rb +0 -35
- data/lib/cucumber/formatter/unicode.rb +0 -35
- data/lib/cucumber/formatter.rb +0 -1
- data/lib/cucumber/formatters/unicode.rb +0 -2
- data/lib/cucumber/jbehave.rb +0 -102
- data/lib/cucumber/languages.yml +0 -339
- data/lib/cucumber/parser/basic.rb +0 -0
- data/lib/cucumber/parser/feature.rb +0 -1490
- data/lib/cucumber/parser/feature.tt +0 -188
- data/lib/cucumber/parser/i18n.tt +0 -31
- data/lib/cucumber/parser/table.rb +0 -402
- data/lib/cucumber/parser/table.tt +0 -59
- data/lib/cucumber/parser/treetop_ext.rb +0 -75
- data/lib/cucumber/parser.rb +0 -43
- data/lib/cucumber/platform.rb +0 -18
- data/lib/cucumber/rails/rspec.rb +0 -8
- data/lib/cucumber/rails/world.rb +0 -73
- data/lib/cucumber/rake/task.rb +0 -111
- data/lib/cucumber/step_definition.rb +0 -87
- data/lib/cucumber/step_mother.rb +0 -183
- data/lib/cucumber/version.rb +0 -10
- data/lib/cucumber.rb +0 -71
- data/rails_generators/cucumber/USAGE +0 -14
- data/rails_generators/cucumber/cucumber_generator.rb +0 -54
- data/rails_generators/cucumber/templates/cucumber +0 -8
- data/rails_generators/cucumber/templates/cucumber.rake +0 -12
- data/rails_generators/cucumber/templates/env.rb +0 -16
- data/rails_generators/cucumber/templates/paths.rb +0 -12
- data/rails_generators/cucumber/templates/webrat_steps.rb +0 -99
- data/rails_generators/feature/USAGE +0 -15
- data/rails_generators/feature/feature_generator.rb +0 -60
- data/rails_generators/feature/templates/feature.erb +0 -31
- data/rails_generators/feature/templates/steps.erb +0 -24
- data/spec/cucumber/ast/background_spec.rb +0 -58
- data/spec/cucumber/ast/feature_factory.rb +0 -54
- data/spec/cucumber/ast/feature_spec.rb +0 -60
- data/spec/cucumber/ast/py_string_spec.rb +0 -40
- data/spec/cucumber/ast/scenario_outline_spec.rb +0 -64
- data/spec/cucumber/ast/scenario_spec.rb +0 -82
- data/spec/cucumber/ast/step_spec.rb +0 -45
- data/spec/cucumber/ast/table_spec.rb +0 -81
- data/spec/cucumber/ast/tags_spec.rb +0 -23
- data/spec/cucumber/broadcaster_spec.rb +0 -14
- data/spec/cucumber/cli/configuration_spec.rb +0 -239
- data/spec/cucumber/cli/main_spec.rb +0 -164
- data/spec/cucumber/core_ext/proc_spec.rb +0 -37
- data/spec/cucumber/core_ext/string_spec.rb +0 -42
- data/spec/cucumber/formatter/ansicolor_spec.rb +0 -35
- data/spec/cucumber/formatter/html/cucumber.css +0 -37
- data/spec/cucumber/formatter/html/cucumber.js +0 -13
- data/spec/cucumber/formatter/html/index.html +0 -45
- data/spec/cucumber/formatter/html/jquery-1.3.min.js +0 -19
- data/spec/cucumber/formatter/html/jquery.uitableedit.js +0 -100
- data/spec/cucumber/formatters/profile_formatter_spec.rb +0 -198
- data/spec/cucumber/parser/feature_parser_spec.rb +0 -281
- data/spec/cucumber/parser/table_parser_spec.rb +0 -48
- data/spec/cucumber/rails/stubs/mini_rails.rb +0 -18
- data/spec/cucumber/rails/stubs/test_help.rb +0 -1
- data/spec/cucumber/rails/world_spec.rb +0 -11
- data/spec/cucumber/sell_cucumbers.feature +0 -19
- data/spec/cucumber/step_definition_spec.rb +0 -62
- data/spec/cucumber/step_mother_spec.rb +0 -73
- data/spec/cucumber/treetop_parser/empty_feature.feature +0 -4
- data/spec/cucumber/treetop_parser/empty_scenario.feature +0 -9
- data/spec/cucumber/treetop_parser/empty_scenario_outline.feature +0 -3
- data/spec/cucumber/treetop_parser/fit_scenario.feature +0 -8
- data/spec/cucumber/treetop_parser/given_scenario.feature +0 -9
- data/spec/cucumber/treetop_parser/invalid_scenario_outlines.feature +0 -7
- data/spec/cucumber/treetop_parser/multiline_steps.feature +0 -17
- data/spec/cucumber/treetop_parser/multiple_tables.feature +0 -27
- data/spec/cucumber/treetop_parser/scenario_outline.feature +0 -16
- data/spec/cucumber/treetop_parser/spaces.feature +0 -12
- data/spec/cucumber/treetop_parser/test_dos.feature +0 -25
- data/spec/cucumber/treetop_parser/with_comments.feature +0 -10
- data/spec/cucumber/treetop_parser/with_tags.feature +0 -18
- data/spec/cucumber/world/pending_spec.rb +0 -47
- data/spec/spec.opts +0 -3
- data/spec/spec_helper.rb +0 -21
@@ -1,53 +0,0 @@
|
|
1
|
-
# Exception extension that tweaks Exception backtraces:
|
2
|
-
#
|
3
|
-
# * The line of the failing .feature line is appended to the backtrace
|
4
|
-
# * The line that calls #cucumber_instance_exec is replaced with the StepDefinition's regexp
|
5
|
-
# * Non intersting lines are stripped out
|
6
|
-
#
|
7
|
-
# The result is that backtraces look like this:
|
8
|
-
#
|
9
|
-
# features/step_definitions/the_step_definition.rb:in `/some step/'
|
10
|
-
# features/the_feature_file.feature:41:in `Given some step'
|
11
|
-
#
|
12
|
-
# or if the exception is raised in the tested code:
|
13
|
-
#
|
14
|
-
# lib/myapp/some_file.rb:in `/some_method/'
|
15
|
-
# lib/myapp/some_other_file.rb:in `/some_other_method/'
|
16
|
-
# features/step_definitions/the_step_definition.rb:in `/some step/'
|
17
|
-
# features/the_feature_file.feature:41:in `Given some step'
|
18
|
-
#
|
19
|
-
# All backtrace munging can be turned off with the <tt>--backtrace</tt> switch
|
20
|
-
#
|
21
|
-
class Exception
|
22
|
-
CUCUMBER_FILTER_PATTERNS = [
|
23
|
-
/vendor\/rails|lib\/cucumber|lib\/rspec|gems\//
|
24
|
-
]
|
25
|
-
|
26
|
-
INSTANCE_EXEC_OFFSET = (Cucumber::RUBY_1_9 || Cucumber::JRUBY) ? -3 : -4
|
27
|
-
|
28
|
-
def self.cucumber_full_backtrace=(v)
|
29
|
-
@@cucumber_full_backtrace = v
|
30
|
-
end
|
31
|
-
self.cucumber_full_backtrace = false
|
32
|
-
|
33
|
-
# Strips the backtrace from +line+ and down
|
34
|
-
def self.cucumber_strip_backtrace!(backtrace, instance_exec_invocation_line, pseudo_method)
|
35
|
-
return if @@cucumber_full_backtrace
|
36
|
-
|
37
|
-
instance_exec_pos = backtrace.index(instance_exec_invocation_line)
|
38
|
-
if instance_exec_pos
|
39
|
-
replacement_line = instance_exec_pos + INSTANCE_EXEC_OFFSET
|
40
|
-
backtrace[replacement_line].gsub!(/`.*'/, "`#{pseudo_method}'") if pseudo_method
|
41
|
-
backtrace[replacement_line+1..-1] = nil
|
42
|
-
|
43
|
-
backtrace.compact!
|
44
|
-
else
|
45
|
-
# This happens with rails, because they screw up the backtrace
|
46
|
-
# before we get here (injecting erb stacktrace and such)
|
47
|
-
end
|
48
|
-
|
49
|
-
backtrace.reject! do |line|
|
50
|
-
CUCUMBER_FILTER_PATTERNS.detect{|p| line =~ p}
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
require 'cucumber/platform'
|
2
|
-
|
3
|
-
module Cucumber
|
4
|
-
class ArityMismatchError < StandardError
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
class Object
|
9
|
-
def cucumber_instance_exec(check_arity, pseudo_method, *args, &block)
|
10
|
-
arity = block.arity
|
11
|
-
arity = 0 if arity == -1
|
12
|
-
cucumber_run_with_backtrace_filtering(pseudo_method) do
|
13
|
-
if check_arity && args.length != arity
|
14
|
-
instance_exec do
|
15
|
-
raise Cucumber::ArityMismatchError.new("expected #{arity} block argument(s), got #{args.length}")
|
16
|
-
end
|
17
|
-
else
|
18
|
-
instance_exec(*args, &block)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def cucumber_run_with_backtrace_filtering(pseudo_method)
|
24
|
-
begin
|
25
|
-
yield
|
26
|
-
rescue Exception => e
|
27
|
-
instance_exec_invocation_line = "#{__FILE__}:#{__LINE__ - 2}:in `cucumber_run_with_backtrace_filtering'"
|
28
|
-
Exception.cucumber_strip_backtrace!((e.backtrace || []), instance_exec_invocation_line, pseudo_method)
|
29
|
-
raise e
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
unless defined? instance_exec # 1.9
|
34
|
-
# http://eigenclass.org/hiki/bounded+space+instance_exec
|
35
|
-
module InstanceExecHelper; end
|
36
|
-
include InstanceExecHelper
|
37
|
-
def instance_exec(*args, &block)
|
38
|
-
begin
|
39
|
-
old_critical, Thread.critical = Thread.critical, true
|
40
|
-
n = 0
|
41
|
-
n += 1 while respond_to?(mname="__instance_exec#{n}")
|
42
|
-
InstanceExecHelper.module_eval{ define_method(mname, &block) }
|
43
|
-
ensure
|
44
|
-
Thread.critical = old_critical
|
45
|
-
end
|
46
|
-
begin
|
47
|
-
ret = send(mname, *args)
|
48
|
-
ensure
|
49
|
-
InstanceExecHelper.module_eval{ remove_method(mname) } rescue nil
|
50
|
-
end
|
51
|
-
ret
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# Proc extension to get more location info out of a proc
|
2
|
-
class Proc
|
3
|
-
PROC_PATTERN = /[\d\w]+@(.*):(.*)>/
|
4
|
-
|
5
|
-
if Proc.new{}.to_s =~ PROC_PATTERN
|
6
|
-
def to_backtrace_line(name)
|
7
|
-
"#{file_colon_line}:in `#{name}'"
|
8
|
-
end
|
9
|
-
|
10
|
-
def to_comment_line
|
11
|
-
"# #{file_colon_line}"
|
12
|
-
end
|
13
|
-
|
14
|
-
def file_colon_line
|
15
|
-
path, line = *to_s.match(PROC_PATTERN)[1..2]
|
16
|
-
path = File.expand_path(path)
|
17
|
-
pwd = Dir.pwd
|
18
|
-
path = path[pwd.length+1..-1]
|
19
|
-
"#{path}:#{line}"
|
20
|
-
end
|
21
|
-
else
|
22
|
-
# This Ruby implementation doesn't implement Proc#to_s correctly
|
23
|
-
STDERR.puts "*** THIS RUBY IMPLEMENTATION DOESN'T REPORT FILE AND LINE FOR PROCS ***"
|
24
|
-
|
25
|
-
def to_backtrace_line
|
26
|
-
nil
|
27
|
-
end
|
28
|
-
|
29
|
-
def to_comment_line
|
30
|
-
""
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
class String
|
2
|
-
def indent(n)
|
3
|
-
if n >= 0
|
4
|
-
gsub(/^/, ' ' * n)
|
5
|
-
else
|
6
|
-
gsub(/^ {0,#{-n}}/, "")
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
# re.source.gsub(/\([^)]*\)/, '$var')
|
11
|
-
# Cumulative #sub
|
12
|
-
def subs(re, *args)
|
13
|
-
args.inject(self) do |s,arg|
|
14
|
-
s.sub(re, arg)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
# TODO: Use subs instead...
|
19
|
-
def gzub(regexp, format=nil, &proc)
|
20
|
-
md = match(regexp)
|
21
|
-
raise "#{self.inspect} doesn't match #{regexp.inspect}" if md.nil?
|
22
|
-
|
23
|
-
s = dup
|
24
|
-
pos = 0
|
25
|
-
md.captures.each_with_index do |m, n|
|
26
|
-
replacement = if block_given?
|
27
|
-
proc.call(m)
|
28
|
-
elsif Proc === format
|
29
|
-
format.call(m)
|
30
|
-
else
|
31
|
-
format % m
|
32
|
-
end
|
33
|
-
|
34
|
-
if md.offset(n+1)[0]
|
35
|
-
s[md.offset(n+1)[0] + pos, m.length] = replacement
|
36
|
-
pos += replacement.length - m.length
|
37
|
-
end
|
38
|
-
end
|
39
|
-
s
|
40
|
-
end
|
41
|
-
|
42
|
-
if (Cucumber::JRUBY && Cucumber::RAILS) || Cucumber::RUBY_1_9
|
43
|
-
# Workaround for http://tinyurl.com/55uu3u
|
44
|
-
alias jlength length
|
45
|
-
else
|
46
|
-
require 'jcode'
|
47
|
-
end
|
48
|
-
end
|
@@ -1,103 +0,0 @@
|
|
1
|
-
gem 'term-ansicolor'
|
2
|
-
require 'term/ansicolor'
|
3
|
-
|
4
|
-
if Cucumber::WINDOWS_MRI
|
5
|
-
begin
|
6
|
-
gem 'win32console', '>= 1.2.0'
|
7
|
-
require 'Win32/Console/ANSI'
|
8
|
-
rescue LoadError
|
9
|
-
STDERR.puts "*** WARNING: You must gem install win32console (1.2.0 or higher) to get coloured output on MRI/Windows"
|
10
|
-
Term::ANSIColor.coloring = false
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
Term::ANSIColor.coloring = false if !STDOUT.tty? || (Cucumber::WINDOWS && !Cucumber::WINDOWS_MRI)
|
15
|
-
|
16
|
-
module Cucumber
|
17
|
-
module Formatter
|
18
|
-
# Defines aliases for coloured output. You can tweak the colours by defining
|
19
|
-
# a <tt>CUCUMBER_COLORS</tt> variable in your shell, very much like you can
|
20
|
-
# tweak the familiar POSIX command <tt>ls</tt> with
|
21
|
-
# <a href="http://mipsisrisc.com/rambling/2008/06/27/lscolorsls_colors-now-with-linux-support/">$LSCOLORS/$LS_COLORS</a>
|
22
|
-
#
|
23
|
-
# The colours that you can change are:
|
24
|
-
#
|
25
|
-
# * <tt>undefined</tt> - defaults to <tt>yellow</tt>
|
26
|
-
# * <tt>pending</tt> - defaults to <tt>yellow</tt>
|
27
|
-
# * <tt>pending_param</tt> - defaults to <tt>yellow,bold</tt>
|
28
|
-
# * <tt>failed</tt> - defaults to <tt>red</tt>
|
29
|
-
# * <tt>failed_param</tt> - defaults to <tt>red,bold</tt>
|
30
|
-
# * <tt>passed</tt> - defaults to <tt>green</tt>
|
31
|
-
# * <tt>passed_param</tt> - defaults to <tt>green,bold</tt>
|
32
|
-
# * <tt>outline</tt> - defaults to <tt>cyan</tt>
|
33
|
-
# * <tt>outline_param</tt> - defaults to <tt>cyan,bold</tt>
|
34
|
-
# * <tt>skipped</tt> - defaults to <tt>cyan</tt>
|
35
|
-
# * <tt>skipped_param</tt> - defaults to <tt>cyan,bold</tt>
|
36
|
-
# * <tt>comment</tt> - defaults to <tt>grey</tt>
|
37
|
-
# * <tt>tag</tt> - defaults to <tt>cyan</tt>
|
38
|
-
#
|
39
|
-
# For instance, if your shell has a black background and a green font (like the
|
40
|
-
# "Homebrew" settings for OS X' Terminal.app), you may want to override passed
|
41
|
-
# steps to be white instead of green. Examples:
|
42
|
-
#
|
43
|
-
# export CUCUMBER_COLORS="passed=white"
|
44
|
-
# export CUCUMBER_COLORS="passed=white,bold:passed_param=white,bold,underline"
|
45
|
-
#
|
46
|
-
# (If you're on Windows, use SET instead of export).
|
47
|
-
# To see what colours and effects are available, just run this in your shell:
|
48
|
-
#
|
49
|
-
# ruby -e "require 'rubygems'; require 'term/ansicolor'; puts Term::ANSIColor.attributes"
|
50
|
-
#
|
51
|
-
# Although not listed, you can also use <tt>grey</tt>
|
52
|
-
module ANSIColor
|
53
|
-
include Term::ANSIColor
|
54
|
-
|
55
|
-
# Not supported in Term::ANSIColor
|
56
|
-
def grey(m)
|
57
|
-
if ::Term::ANSIColor.coloring?
|
58
|
-
"\e[90m#{m}\e[0m"
|
59
|
-
else
|
60
|
-
m
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
ALIASES = Hash.new do |h,k|
|
65
|
-
if k.to_s =~ /(.*)_param/
|
66
|
-
h[$1] + ',bold'
|
67
|
-
end
|
68
|
-
end.merge({
|
69
|
-
'undefined' => 'yellow',
|
70
|
-
'pending' => 'yellow',
|
71
|
-
'failed' => 'red',
|
72
|
-
'passed' => 'green',
|
73
|
-
'thead' => 'cyan',
|
74
|
-
'outline' => 'cyan',
|
75
|
-
'skipped' => 'cyan',
|
76
|
-
'comment' => 'grey',
|
77
|
-
'tag' => 'cyan'
|
78
|
-
})
|
79
|
-
|
80
|
-
if ENV['CUCUMBER_COLORS'] # Example: export CUCUMBER_COLORS="passed=red:failed=yellow"
|
81
|
-
ENV['CUCUMBER_COLORS'].split(':').each do |pair|
|
82
|
-
a = pair.split('=')
|
83
|
-
ALIASES[a[0]] = a[1]
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
ALIASES.each do |method, color|
|
88
|
-
unless method =~ /.*_param/
|
89
|
-
code = <<-EOF
|
90
|
-
def #{method}(string=nil, &proc)
|
91
|
-
#{ALIASES[method].split(",").join("(") + "(string, &proc" + ")" * ALIASES[method].split(",").length}
|
92
|
-
end
|
93
|
-
# This resets the colour to the non-param colour
|
94
|
-
def #{method}_param(string=nil, &proc)
|
95
|
-
#{ALIASES[method+'_param'].split(",").join("(") + "(string, &proc" + ")" * ALIASES[method+'_param'].split(",").length} + #{ALIASES[method].split(",").join(' + ')}
|
96
|
-
end
|
97
|
-
EOF
|
98
|
-
eval(code)
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'forwardable'
|
2
|
-
|
3
|
-
module Cucumber
|
4
|
-
module Formatter
|
5
|
-
# Adapter to make #puts/#print/#flush work with colours on Windows
|
6
|
-
class ColorIO
|
7
|
-
extend Forwardable
|
8
|
-
def_delegators :@kernel, :puts, :print # win32console colours only work when sent to Kernel
|
9
|
-
def_delegators :@stdout, :flush, :tty?
|
10
|
-
|
11
|
-
def initialize
|
12
|
-
@kernel = Kernel
|
13
|
-
@stdout = STDOUT
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,119 +0,0 @@
|
|
1
|
-
require 'cucumber/formatter/ansicolor'
|
2
|
-
|
3
|
-
module Cucumber
|
4
|
-
module Formatter
|
5
|
-
module Console
|
6
|
-
extend ANSIColor
|
7
|
-
FORMATS = Hash.new{|hash, format| hash[format] = method(format).to_proc}
|
8
|
-
|
9
|
-
def format_step(keyword, step_name, status, step_definition, source_indent)
|
10
|
-
comment = if source_indent && step_definition
|
11
|
-
c = (' # ' + step_definition.file_colon_line).indent(source_indent)
|
12
|
-
format_string(c, :comment)
|
13
|
-
else
|
14
|
-
''
|
15
|
-
end
|
16
|
-
|
17
|
-
begin
|
18
|
-
line = keyword + " " + step_definition.format_args(step_name, format_for(status, :param)) + comment
|
19
|
-
rescue
|
20
|
-
# It didn't match. This often happens for :outline steps
|
21
|
-
line = keyword + " " + step_name + comment
|
22
|
-
end
|
23
|
-
|
24
|
-
format_string(line, status)
|
25
|
-
end
|
26
|
-
|
27
|
-
def format_string(string, status)
|
28
|
-
fmt = format_for(status)
|
29
|
-
if Proc === fmt
|
30
|
-
fmt.call(string)
|
31
|
-
else
|
32
|
-
fmt % string
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def print_undefined_scenarios(features)
|
37
|
-
elements = features.scenarios.select{|scenario| scenario.undefined?}
|
38
|
-
print_elements(elements, :undefined, 'scenarios')
|
39
|
-
end
|
40
|
-
|
41
|
-
def print_steps(features, status)
|
42
|
-
print_elements(features.steps[status], status, 'steps')
|
43
|
-
end
|
44
|
-
|
45
|
-
def print_elements(elements, status, kind)
|
46
|
-
if elements.any?
|
47
|
-
@io.puts(format_string("(::) #{status} #{kind} (::)", status))
|
48
|
-
@io.puts
|
49
|
-
@io.flush
|
50
|
-
end
|
51
|
-
|
52
|
-
elements.each_with_index do |element, i|
|
53
|
-
if status == :failed
|
54
|
-
print_exception(element.exception, 0)
|
55
|
-
else
|
56
|
-
@io.puts(format_string(element.backtrace_line, status))
|
57
|
-
end
|
58
|
-
@io.puts
|
59
|
-
@io.flush
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
def print_counts(features)
|
64
|
-
@io.puts dump_count(features.scenarios.length, "scenario")
|
65
|
-
|
66
|
-
[:failed, :skipped, :undefined, :pending, :passed].each do |status|
|
67
|
-
if features.steps[status].any?
|
68
|
-
count_string = dump_count(features.steps[status].length, "step", status.to_s)
|
69
|
-
@io.puts format_string(count_string, status)
|
70
|
-
@io.flush
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
def print_exception(e, indent)
|
76
|
-
status = Cucumber::EXCEPTION_STATUS[e.class]
|
77
|
-
@io.puts(format_string("#{e.message} (#{e.class})\n#{e.backtrace.join("\n")}".indent(indent), status))
|
78
|
-
end
|
79
|
-
|
80
|
-
def print_snippets(features, options)
|
81
|
-
return unless options[:snippets]
|
82
|
-
undefined = features.steps[:undefined]
|
83
|
-
return if undefined.empty?
|
84
|
-
snippets = undefined.map do |step|
|
85
|
-
step_name = Undefined === step.exception ? step.exception.step_name : step.name
|
86
|
-
snippet = @step_mother.snippet_text(step.actual_keyword, step_name)
|
87
|
-
snippet
|
88
|
-
end.compact.uniq
|
89
|
-
|
90
|
-
text = "\nYou can implement step definitions for missing steps with these snippets:\n\n"
|
91
|
-
text += snippets.join("\n\n")
|
92
|
-
|
93
|
-
@io.puts format_string(text, :undefined)
|
94
|
-
@io.puts
|
95
|
-
@io.flush
|
96
|
-
end
|
97
|
-
|
98
|
-
private
|
99
|
-
|
100
|
-
def with_color
|
101
|
-
c = Term::ANSIColor.coloring?
|
102
|
-
Term::ANSIColor.coloring = @io.tty?
|
103
|
-
yield
|
104
|
-
Term::ANSIColor.coloring = c
|
105
|
-
end
|
106
|
-
|
107
|
-
def dump_count(count, what, state=nil)
|
108
|
-
[count, state, "#{what}#{count == 1 ? '' : 's'}"].compact.join(" ")
|
109
|
-
end
|
110
|
-
|
111
|
-
def format_for(*keys)
|
112
|
-
key = keys.join('_').to_sym
|
113
|
-
fmt = FORMATS[key]
|
114
|
-
raise "No format for #{key.inspect}: #{FORMATS.inspect}" if fmt.nil?
|
115
|
-
fmt
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
.cucumber {
|
7
|
-
background: black;
|
8
|
-
color: white;
|
9
|
-
padding: 1em;
|
10
|
-
}
|
11
|
-
.cucumber .passed {
|
12
|
-
color: green;
|
13
|
-
}
|
14
|
-
.cucumber .undefined {
|
15
|
-
color: yellow;
|
16
|
-
}
|
17
|
-
.cucumber .pending {
|
18
|
-
color: yellow;
|
19
|
-
}
|
20
|
-
.cucumber .failed {
|
21
|
-
color: red;
|
22
|
-
}
|
23
|
-
.cucumber .skipped {
|
24
|
-
color: cyan;
|
25
|
-
}
|
26
|
-
.cucumber .outline {
|
27
|
-
color: cyan;
|
28
|
-
}
|
29
|
-
.cucumber .param {
|
30
|
-
font-weight: bold;
|
31
|
-
}
|
32
|
-
.cucumber a {
|
33
|
-
text-decoration: none;
|
34
|
-
color: inherit;
|
35
|
-
}
|
36
|
-
.cucumber a:hover {
|
37
|
-
text-decoration: underline;
|
38
|
-
}
|
39
|
-
.cucumber a:visited {
|
40
|
-
font-weight: normal;
|
41
|
-
}
|
42
|
-
.cucumber ol {
|
43
|
-
list-style: none;
|
44
|
-
}
|
45
|
-
.cucumber .stats {
|
46
|
-
margin: 2em;
|
47
|
-
}
|
48
|
-
.cucumber .summary ul.features li {
|
49
|
-
display: inline;
|
50
|
-
}
|
51
|
-
.cucumber .backtrace {
|
52
|
-
margin-top: 0;
|
53
|
-
margin-bottom: 0;
|
54
|
-
margin-left: 1em;
|
55
|
-
}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# cucumber.css is generated from cucumber.sass
|
2
|
-
# Regenerate with the following command:
|
3
|
-
#
|
4
|
-
# sass -t expanded lib/cucumber/formatter/cucumber.sass > lib/cucumber/formatter/cucumber.css
|
5
|
-
#
|
6
|
-
.cucumber
|
7
|
-
:background black
|
8
|
-
:color white
|
9
|
-
:padding 1em
|
10
|
-
|
11
|
-
.passed
|
12
|
-
:color green
|
13
|
-
.undefined
|
14
|
-
:color yellow
|
15
|
-
.pending
|
16
|
-
:color yellow
|
17
|
-
.failed
|
18
|
-
:color red
|
19
|
-
.skipped
|
20
|
-
:color cyan
|
21
|
-
.outline
|
22
|
-
:color cyan
|
23
|
-
.param
|
24
|
-
:font-weight bold
|
25
|
-
|
26
|
-
a
|
27
|
-
:text-decoration none
|
28
|
-
:color inherit
|
29
|
-
|
30
|
-
&:hover
|
31
|
-
:text-decoration underline
|
32
|
-
&:visited
|
33
|
-
:font-weight normal
|
34
|
-
|
35
|
-
ol
|
36
|
-
:list-style none
|
37
|
-
|
38
|
-
.stats
|
39
|
-
:margin 2em
|
40
|
-
|
41
|
-
.summary
|
42
|
-
ul.features
|
43
|
-
li
|
44
|
-
:display inline
|
45
|
-
|
46
|
-
.backtrace
|
47
|
-
:margin-top 0
|
48
|
-
:margin-bottom 0
|
49
|
-
:margin-left 1em
|
@@ -1,121 +0,0 @@
|
|
1
|
-
require 'builder'
|
2
|
-
|
3
|
-
module Cucumber
|
4
|
-
module Formatter
|
5
|
-
class Html < Ast::Visitor
|
6
|
-
def initialize(step_mother, io, options)
|
7
|
-
super(step_mother)
|
8
|
-
@builder = Builder::XmlMarkup.new(:target => io, :indent => 2)
|
9
|
-
end
|
10
|
-
|
11
|
-
def visit_features(features)
|
12
|
-
# <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
13
|
-
@builder.declare!(
|
14
|
-
:DOCTYPE,
|
15
|
-
:html,
|
16
|
-
:PUBLIC,
|
17
|
-
'-//W3C//DTD XHTML 1.0 Strict//EN',
|
18
|
-
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'
|
19
|
-
)
|
20
|
-
@builder.html(:xmlns => 'http://www.w3.org/1999/xhtml') do
|
21
|
-
@builder.head do
|
22
|
-
@builder.title 'Cucumber'
|
23
|
-
inline_css
|
24
|
-
end
|
25
|
-
@builder.body do
|
26
|
-
@builder.div(:class => 'cucumber') do
|
27
|
-
super
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def visit_feature(feature)
|
34
|
-
@builder.div(:class => 'feature') do
|
35
|
-
super
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def visit_feature_name(name)
|
40
|
-
lines = name.split(/\r?\n/)
|
41
|
-
@builder.h2(lines[0])
|
42
|
-
@builder.p do
|
43
|
-
lines[1..-1].each do |line|
|
44
|
-
@builder.text!(line.strip)
|
45
|
-
@builder.br
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def visit_background(background)
|
51
|
-
@builder.div(:class => 'background') do
|
52
|
-
@builder.ol do
|
53
|
-
super
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
def visit_feature_element(feature_element)
|
59
|
-
@builder.div(:class => 'scenario') do
|
60
|
-
super
|
61
|
-
end
|
62
|
-
@open_step_list = true
|
63
|
-
end
|
64
|
-
|
65
|
-
def visit_scenario_name(keyword, name, file_line, source_indent)
|
66
|
-
@builder.h3("#{keyword} #{name}")
|
67
|
-
end
|
68
|
-
|
69
|
-
def visit_outline_table(outline_table)
|
70
|
-
@builder.table do
|
71
|
-
super(outline_table)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
def visit_examples_name(keyword, name)
|
76
|
-
@builder.h4("#{keyword} #{name}")
|
77
|
-
end
|
78
|
-
|
79
|
-
def visit_steps(scenarios)
|
80
|
-
@builder.ol do
|
81
|
-
super
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
def visit_step_name(keyword, step_name, status, step_definition, source_indent)
|
86
|
-
@builder.li("#{keyword} #{step_name}", :class => status)
|
87
|
-
end
|
88
|
-
|
89
|
-
def visit_multiline_arg(multiline_arg, status)
|
90
|
-
if Ast::Table === multiline_arg
|
91
|
-
@builder.table do
|
92
|
-
super(multiline_arg, status)
|
93
|
-
end
|
94
|
-
else
|
95
|
-
@builder.p do
|
96
|
-
super(multiline_arg, status)
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
def visit_table_row(table_row, status)
|
102
|
-
@builder.tr do
|
103
|
-
super(table_row, status)
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
def visit_table_cell_value(value, width, status)
|
108
|
-
@builder.td(value, :class => status)
|
109
|
-
end
|
110
|
-
|
111
|
-
private
|
112
|
-
|
113
|
-
def inline_css
|
114
|
-
@builder.style(:type => 'text/css') do
|
115
|
-
@builder.text!(File.read(File.dirname(__FILE__) + '/cucumber.css'))
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|