Class: JasmineNodeCoverageRunner
- Inherits:
-
Object
- Object
- JasmineNodeCoverageRunner
- Defined in:
- lib/tasks/jasmine_node_coverage/jasmine_node_coverage_runner.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(jasmine_runner, coverage, config) ⇒ JasmineNodeCoverageRunner
constructor
A new instance of JasmineNodeCoverageRunner.
- #is_configured?(all_files) ⇒ Boolean
- #name ⇒ Object
- #should_run?(modified_files) ⇒ Boolean
Constructor Details
#initialize(jasmine_runner, coverage, config) ⇒ JasmineNodeCoverageRunner
Returns a new instance of JasmineNodeCoverageRunner.
5 6 7 8 9 |
# File 'lib/tasks/jasmine_node_coverage/jasmine_node_coverage_runner.rb', line 5 def initialize(jasmine_runner, coverage, config) @jasmine_runner = jasmine_runner @coverage = coverage @config = config end |
Instance Method Details
#execute ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/tasks/jasmine_node_coverage/jasmine_node_coverage_runner.rb', line 15 def execute @config.reload source_dir = @config.source_dir coverage_dir = source_dir + "-cov" FileUtils.rm_rf coverage_dir output = @coverage.run source_dir, coverage_dir @jasmine_runner.source_dir coverage_dir return output + "\n\n" + @jasmine_runner.execute end |
#is_configured?(all_files) ⇒ Boolean
28 29 30 |
# File 'lib/tasks/jasmine_node_coverage/jasmine_node_coverage_runner.rb', line 28 def is_configured?(all_files) return @jasmine_runner.is_configured? all_files end |
#name ⇒ Object
11 12 13 |
# File 'lib/tasks/jasmine_node_coverage/jasmine_node_coverage_runner.rb', line 11 def name return 'Coverage' end |
#should_run?(modified_files) ⇒ Boolean
32 33 34 |
# File 'lib/tasks/jasmine_node_coverage/jasmine_node_coverage_runner.rb', line 32 def should_run?(modified_files) return @jasmine_runner.should_run? modified_files end |