forked from cucumber/cucumber-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcuke
executable file
·60 lines (47 loc) · 1.48 KB
/
cuke
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env ruby
# encoding: UTF-8
$: << File.dirname(__FILE__) + '/../lib'
$: << File.dirname(__FILE__) + '/../../cucumber-ruby-core/lib'
require 'cucumber/platform'
module Cucumber
features_glob = ARGV[0] || 'features/**/*.feature'
feature_files = Dir[features_glob].reject { |f| f =~ /iso-8859-1/ }
puts "Running features:"
p feature_files
require 'cucumber/core'
extend Cucumber::Core
require 'cucumber/core/gherkin/document'
features = feature_files.map do |file|
Cucumber::Core::Gherkin::Document.new(file, File.read(file))
end
require 'cucumber/mappings'
mappings = Mappings.new
require 'cucumber/formatter/report_adapter'
require 'cucumber/formatter/progress'
require 'cucumber/formatter/pretty'
formatter_options = {
skip_profile_information: true,
source: true,
}
formatter = Cucumber::Formatter::Pretty.new(mappings.runtime, STDOUT, formatter_options)
report = Cucumber::Formatter::ReportAdapter.new(mappings.runtime, formatter)
DebugReport = Class.new do
def before_test_case(test_case)
puts
puts test_case.inspect
end
def after_test_case(test_case, result)
end
def before_test_step(test_step)
puts ' ' + test_step.inspect
end
def after_test_step(test_step, result)
end
def after_suite
end
end
#report = DebugReport.new
require 'cucumber/core/test/tag_filter'
execute features, mappings, report, [[Cucumber::Core::Test::TagFilter, ['~@jruby']]]
report.after_suite
end