Class: Opal::RSpec::SprocketsEnvironment

Inherits:
Sprockets::Environment
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/opal/rspec/sprockets_environment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#locatorObject (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_sprocketsObject



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

#cachedObject



34
35
36
# File 'lib/opal/rspec/sprockets_environment.rb', line 34

def cached
  CachedEnvironment.new(self, @locator)
end