Class: Opal::RSpec::PreRackLocator
- Inherits:
-
Object
- Object
- Opal::RSpec::PreRackLocator
- Includes:
- RSpec::Core::RubyProject
- Defined in:
- lib/opal/rspec/pre_rack_locator.rb
Constant Summary collapse
- DEFAULT_PATTERN =
'spec/**/*_spec.{rb,opal}'
- DEFAULT_DEFAULT_PATH =
'spec'
Instance Attribute Summary collapse
-
#default_path ⇒ Object
Returns the value of attribute default_path.
-
#spec_exclude_pattern ⇒ Object
Returns the value of attribute spec_exclude_pattern.
-
#spec_files ⇒ Object
Returns the value of attribute spec_files.
-
#spec_pattern ⇒ Object
Returns the value of attribute spec_pattern.
Instance Method Summary collapse
- #determine_root ⇒ Object
- #get_spec_load_paths ⇒ Object
-
#initialize(spec_pattern = nil, spec_exclude_pattern = nil, spec_files = nil, default_path = nil) ⇒ PreRackLocator
constructor
A new instance of PreRackLocator.
Constructor Details
#initialize(spec_pattern = nil, spec_exclude_pattern = nil, spec_files = nil, default_path = nil) ⇒ PreRackLocator
Returns a new instance of PreRackLocator.
16 17 18 19 20 21 |
# File 'lib/opal/rspec/pre_rack_locator.rb', line 16 def initialize(spec_pattern=nil, spec_exclude_pattern=nil, spec_files=nil, default_path=nil) @spec_pattern = spec_pattern || DEFAULT_PATTERN @spec_exclude_pattern = spec_exclude_pattern @spec_files = spec_files @default_path = default_path || DEFAULT_DEFAULT_PATH end |
Instance Attribute Details
#default_path ⇒ Object
Returns the value of attribute default_path.
14 15 16 |
# File 'lib/opal/rspec/pre_rack_locator.rb', line 14 def default_path @default_path end |
#spec_exclude_pattern ⇒ Object
Returns the value of attribute spec_exclude_pattern.
14 15 16 |
# File 'lib/opal/rspec/pre_rack_locator.rb', line 14 def spec_exclude_pattern @spec_exclude_pattern end |
#spec_files ⇒ Object
Returns the value of attribute spec_files.
14 15 16 |
# File 'lib/opal/rspec/pre_rack_locator.rb', line 14 def spec_files @spec_files end |
#spec_pattern ⇒ Object
Returns the value of attribute spec_pattern.
14 15 16 |
# File 'lib/opal/rspec/pre_rack_locator.rb', line 14 def spec_pattern @spec_pattern end |
Instance Method Details
#determine_root ⇒ Object
23 24 25 |
# File 'lib/opal/rspec/pre_rack_locator.rb', line 23 def determine_root find_first_parent_containing(@default_path) || '.' end |
#get_spec_load_paths ⇒ Object
27 28 29 |
# File 'lib/opal/rspec/pre_rack_locator.rb', line 27 def get_spec_load_paths [@default_path].map { |dir| File.join(root, dir) } end |