Class: MSpecTestRunner
- Inherits:
-
Object
- Object
- MSpecTestRunner
- Includes:
- Albacore::RunCommand, Albacore::Task
- Defined in:
- lib/albacore/mspectestrunner.rb
Constant Summary collapse
- TaskName =
:mspec
Instance Attribute Summary collapse
-
#html_output ⇒ Object
Returns the value of attribute html_output.
Attributes included from Albacore::RunCommand
Attributes included from Logging
Instance Method Summary collapse
- #build_assembly_list ⇒ Object
- #build_html_output ⇒ Object
- #execute ⇒ Object
- #get_command_line ⇒ Object
- #get_command_parameters ⇒ Object
-
#initialize(command = nil) ⇒ MSpecTestRunner
constructor
A new instance of MSpecTestRunner.
Methods included from Albacore::RunCommand
Methods included from AttrMethods
Methods included from Albacore::Task
clean_dirname, create_rake_task, include_config, included
Methods included from UpdateAttributes
Methods included from YAMLConfig
#configure, #load_config_by_task_name
Methods included from Logging
#create_logger, #log_device=, #log_level, #log_level=
Methods included from Failure
Constructor Details
#initialize(command = nil) ⇒ MSpecTestRunner
Returns a new instance of MSpecTestRunner.
11 12 13 14 15 16 |
# File 'lib/albacore/mspectestrunner.rb', line 11 def initialize(command=nil) @assemblies=[] super() update_attributes Albacore.configuration.mspec.to_hash @command = command unless command.nil? end |
Instance Attribute Details
#html_output ⇒ Object
Returns the value of attribute html_output.
8 9 10 |
# File 'lib/albacore/mspectestrunner.rb', line 8 def html_output @html_output end |
Instance Method Details
#build_assembly_list ⇒ Object
43 44 45 |
# File 'lib/albacore/mspectestrunner.rb', line 43 def build_assembly_list @assemblies.map{|asm| "\"#{asm}\""}.join(" ") end |
#build_html_output ⇒ Object
47 48 49 |
# File 'lib/albacore/mspectestrunner.rb', line 47 def build_html_output "--html \"#{@html_output}\"" end |
#execute ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/albacore/mspectestrunner.rb', line 35 def execute() command_params = get_command_parameters result = run_command "MSpec", command_params.join(" ") = 'MSpec Failed. See Build Log For Detail' if !result end |
#get_command_line ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/albacore/mspectestrunner.rb', line 18 def get_command_line command = [] command << @command command << get_command_parameters cmd = command.join(" ") @logger.debug "Build MSpec Test Runner Command Line: " + cmd return cmd end |
#get_command_parameters ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/albacore/mspectestrunner.rb', line 27 def get_command_parameters command_params = [] command_params << build_assembly_list unless @assemblies.empty? command_params << @options.join(" ") unless @options.nil? command_params << build_html_output unless @html_output.nil? command_params end |