Class: RSpecRunner
- Inherits:
-
Object
- Object
- RSpecRunner
- Defined in:
- lib/tasks/rspec/rspec_runner.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(dir, ruby_filter, spec_filter) ⇒ RSpecRunner
constructor
A new instance of RSpecRunner.
- #is_configured?(all_files) ⇒ Boolean
- #name ⇒ Object
- #should_run?(modified_files) ⇒ Boolean
Constructor Details
#initialize(dir, ruby_filter, spec_filter) ⇒ RSpecRunner
Returns a new instance of RSpecRunner.
3 4 5 6 7 |
# File 'lib/tasks/rspec/rspec_runner.rb', line 3 def initialize(dir, ruby_filter, spec_filter) @dir = dir @ruby_filter = ruby_filter @spec_filter = spec_filter end |
Instance Method Details
#execute ⇒ Object
13 14 15 |
# File 'lib/tasks/rspec/rspec_runner.rb', line 13 def execute return `spec . 2>&1` end |
#is_configured?(all_files) ⇒ Boolean
17 18 19 |
# File 'lib/tasks/rspec/rspec_runner.rb', line 17 def is_configured?(all_files) return !(all_files.detect { |file| @spec_filter.filter(file) }).nil? end |
#name ⇒ Object
9 10 11 |
# File 'lib/tasks/rspec/rspec_runner.rb', line 9 def name return 'RSpec' end |
#should_run?(modified_files) ⇒ Boolean
21 22 23 |
# File 'lib/tasks/rspec/rspec_runner.rb', line 21 def should_run?(modified_files) return !(modified_files.detect { |file| @ruby_filter.filter(file) }).nil? end |