Module: TestRailsJs

Defined in:
lib/test_rails_js.rb,
lib/test_rails_js/version.rb

Defined Under Namespace

Classes: Engine, Railtie

Constant Summary collapse

VERSION =
"0.1.2"

Class Method Summary collapse

Class Method Details

.tests(&block) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/test_rails_js.rb', line 2

def self.tests(&block)
  Rails.application.config.assets.paths.inject([]) do |all_tests, path|
    tests = []
    Rails.application.config.test_rails_js.tests_paths.each do |test_path|
      tests += Dir[path + test_path]
    end

    tests = block.call(tests, path) if block_given?
    all_tests + tests
  end
end