Class: Testjour::CLI::SlaveRun
Instance Attribute Summary
Attributes inherited from BaseCommand
#non_options, #options
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from BaseCommand
detailed_help, help, #option_parser, options
Constructor Details
#initialize(parser, args) ⇒ SlaveRun
Returns a new instance of SlaveRun.
18
19
20
21
22
|
# File 'lib/testjour/commands/slave_run.rb', line 18
def initialize(parser, args)
Testjour.logger.debug "Runner command #{self.class}..."
super
@queue = @non_options.first
end
|
Class Method Details
.command ⇒ Object
14
15
16
|
# File 'lib/testjour/commands/slave_run.rb', line 14
def self.command
"slave:run"
end
|
Instance Method Details
#drb_uri ⇒ Object
72
73
74
75
76
77
78
|
# File 'lib/testjour/commands/slave_run.rb', line 72
def drb_uri
uri = URI.parse(@queue)
uri.scheme = "druby"
uri.path = ""
uri.user = nil
uri.to_s
end
|
#feature_parser ⇒ Object
80
81
82
|
# File 'lib/testjour/commands/slave_run.rb', line 80
def feature_parser
@feature_parser ||= Cucumber::TreetopParser::FeatureParser.new
end
|
#queue_server ⇒ Object
65
66
67
68
69
70
|
# File 'lib/testjour/commands/slave_run.rb', line 65
def queue_server
@queue_server ||= begin
DRb.start_service
DRbObject.new(nil, drb_uri)
end
end
|
#require_files ⇒ Object
53
54
55
56
57
|
# File 'lib/testjour/commands/slave_run.rb', line 53
def require_files
cli = Cucumber::CLI.new
cli.parse_options!(@non_options)
cli.send(:require_files)
end
|
#run_file(file) ⇒ Object
59
60
61
62
63
|
# File 'lib/testjour/commands/slave_run.rb', line 59
def run_file(file)
Testjour.logger.debug "Running feature file: #{file}"
features = feature_parser.parse_feature(File.expand_path(file))
Cucumber::CLI.executor.visit_features(features)
end
|