Class: LearnLab::Test::Strategies::Rspec
- Inherits:
-
LearnLab::Test::Strategy
- Object
- LearnLab::Test::Strategy
- LearnLab::Test::Strategies::Rspec
- Defined in:
- lib/learn_lab/test/strategies/rspec.rb
Overview
Test Strategy for RSpec. Mostly lifted from the ‘learn-test` gem without Ironboard specific code. Some other refactorings were also made to improve test coverage and fix Rubocop warnings.
Instance Attribute Summary
Attributes inherited from LearnLab::Test::Strategy
Instance Method Summary collapse
Methods inherited from LearnLab::Test::Strategy
#check_dependencies, #cleanup, #initialize, #output, #result_filename, #results
Constructor Details
This class inherits a constructor from LearnLab::Test::Strategy
Instance Method Details
permalink #detect ⇒ Object
[View source]
11 12 13 14 15 16 |
# File 'lib/learn_lab/test/strategies/rspec.rb', line 11 def detect spec_dir = fs.join(runner.working_directory, 'spec') fs.dir_exist?(spec_dir) && \ (fs.dir_entries(spec_dir).include?('spec_helper.rb') || \ fs.dir_entries(spec_dir).include?('rails_helper.rb')) end |
permalink #parser ⇒ Object
[View source]
27 28 29 |
# File 'lib/learn_lab/test/strategies/rspec.rb', line 27 def parser @parser ||= LearnLab::Test::Parsers::Rspec.new(output) end |
permalink #run ⇒ Object
[View source]
18 19 20 21 22 23 24 25 |
# File 'lib/learn_lab/test/strategies/rspec.rb', line 18 def run = [ '--format documentation', '--format j', "--out #{result_filename}" ] system("#{bundle_command}rspec #{.join(' ')}") end |