Class: Opal::RSpec::SprocketsEnvironment
- Inherits:
-
Sprockets::Environment
- Object
- Sprockets::Environment
- Opal::RSpec::SprocketsEnvironment
- Extended by:
- Forwardable
- Defined in:
- lib/opal/rspec/sprockets_environment.rb
Instance Attribute Summary collapse
-
#locator ⇒ Object
readonly
Returns the value of attribute locator.
Instance Method Summary collapse
- #add_spec_paths_to_sprockets ⇒ Object
- #cached ⇒ Object
-
#initialize(spec_pattern = nil, spec_exclude_pattern = nil, spec_files = nil, default_path = nil) ⇒ SprocketsEnvironment
constructor
A new instance of SprocketsEnvironment.
Constructor Details
#initialize(spec_pattern = nil, spec_exclude_pattern = nil, spec_files = nil, default_path = nil) ⇒ SprocketsEnvironment
Returns a new instance of SprocketsEnvironment.
23 24 25 26 |
# File 'lib/opal/rspec/sprockets_environment.rb', line 23 def initialize(spec_pattern=nil, spec_exclude_pattern=nil, spec_files=nil, default_path=nil) @locator = Opal::RSpec::Locator.new(pattern: spec_pattern, exclude_pattern: spec_exclude_pattern, files: spec_files, default_path: default_path) super() end |
Instance Attribute Details
#locator ⇒ Object (readonly)
Returns the value of attribute locator.
28 29 30 |
# File 'lib/opal/rspec/sprockets_environment.rb', line 28 def locator @locator end |
Instance Method Details
#add_spec_paths_to_sprockets ⇒ Object
30 31 32 |
# File 'lib/opal/rspec/sprockets_environment.rb', line 30 def add_spec_paths_to_sprockets locator.get_spec_load_paths.each { |p| append_path p } end |
#cached ⇒ Object
34 35 36 |
# File 'lib/opal/rspec/sprockets_environment.rb', line 34 def cached CachedEnvironment.new(self, @locator) end |