Skip to content

Commit

Permalink
Do not store rake tasks in lib/tasks.
Browse files Browse the repository at this point in the history
This path is auto-loaded by Rails for all the gems in the app. This is
not the wanted behaviour here, as these tasks are only to test webpacker-react

Fixes #33
  • Loading branch information
renchap committed May 30, 2017
1 parent 25416b7 commit b623d5a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Fixed
- Move test Rake tasks out of `lib/tasks` (fixes #33)

## [0.3.0] - 2017-05-27

### Added
Expand Down
23 changes: 22 additions & 1 deletion Rakefile
@@ -1,5 +1,6 @@
require "bundler/gem_tasks"
require "rake/testtask"
require "English"

Rake::TestTask.new(:test) do |t|
t.libs << "test"
Expand All @@ -10,4 +11,24 @@ end

task default: :test

Dir["lib/tasks/*.rake"].each { |f| load f }
# webpacker:check_webpack_binstubs is looking for binstubs
# in the gem root directory. We need to disable it for our
# tests, as it tries to check they exist when loading the
# example app

task "webpacker:check_webpack_binstubs"
Rake::Task["webpacker:check_webpack_binstubs"].clear

namespace :example_app do
desc "Runs yarn in test/example_app"
task :yarn do
sh "cd test/example_app && yarn"
end

desc "Runs webpack in test/example_app"
task webpack: :yarn do
sh "cd test/example_app && NODE_ENV=test ./bin/webpack"
end
end

Rake::Task["test"].enhance ["example_app:webpack"]
7 changes: 0 additions & 7 deletions lib/tasks/disable_webpacker_checks.rake

This file was deleted.

15 changes: 0 additions & 15 deletions lib/tasks/example_app.rake

This file was deleted.

0 comments on commit b623d5a

Please sign in to comment.