Sha256: 6e9058d92e83b60bd8ceb8271f4f0981f0ba41775763428193561947e534e3bc
Contents?: true
Size: 1.23 KB
Versions: 3
Compression:
Stored size: 1.23 KB
Contents
require 'pathname' require 'rake' # require the bundled RSpec's file and don't rely on the load path in case opal-rspec is included in a project's # Gemfile without rspec also being in the Gemfile require_relative '../../../rspec-core/upstream/lib/rspec/core/ruby_project' module Opal module RSpec class Locator include ::RSpec::Core::RubyProject DEFAULT_PATTERN = 'spec-opal/**/*_spec{.js,}.{rb,opal}' DEFAULT_DEFAULT_PATH = 'spec-opal' attr_accessor :spec_pattern, :spec_exclude_pattern, :spec_files, :default_path def initialize(pattern: nil, exclude_pattern: nil, files: nil, default_path: nil) @spec_pattern = pattern || DEFAULT_PATTERN @spec_exclude_pattern = exclude_pattern @spec_files = files @default_path = default_path || DEFAULT_DEFAULT_PATH end def determine_root find_first_parent_containing(@default_path) || '.' end def get_spec_load_paths [@default_path].map { |dir| File.join(root, dir) } end def get_opal_spec_requires files = @spec_files || FileList[*@spec_pattern].exclude(*@spec_exclude_pattern) files.uniq.map { |file| File.expand_path file } end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
opal-rspec-0.7.0 | lib/opal/rspec/locator.rb |
opal-rspec-0.7.0.rc.2 | lib/opal/rspec/locator.rb |
opal-rspec-0.7.0.rc.1 | lib/opal/rspec/locator.rb |