-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup test with initial test cases #259
Changes from 7 commits
a462c56
8e1fbf5
4d869c9
ba7bb25
7e211e9
2fd731b
9af9696
5aace57
7a2ddf6
a68b51a
f78fadd
ead8736
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
source "https://rubygems.org" | ||
|
||
gemspec | ||
|
||
gem "rails" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,12 @@ | ||
# frozen_string_literal: true | ||
require "bundler/gem_tasks" | ||
require "rake/testtask" | ||
|
||
Rake::TestTask.new(:test) do |t| | ||
t.libs << "test" | ||
t.libs << "lib" | ||
t.test_files = FileList["test/**/*_test.rb"] | ||
t.verbose = true | ||
end | ||
|
||
task default: :test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require "webpacker_test" | ||
|
||
class EnvTest < Minitest::Test | ||
def test_current_env | ||
assert Webpacker::Env.current == "production" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
end | ||
|
||
def test_env_is_development? | ||
refute Webpacker::Env.development? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
end | ||
|
||
def test_file_path | ||
correct_path = File.join(File.dirname(__FILE__), "config", "webpack", "paths.yml").to_s | ||
assert Webpacker::Env.file_path.to_s == correct_path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
require "minitest/autorun" | ||
require "rails" | ||
require "rails/test_help" | ||
require "webpacker" | ||
|
||
module TestApp | ||
class Application < ::Rails::Application | ||
config.root = File.dirname(__FILE__) | ||
end | ||
end | ||
|
||
TestApp::Application.initialize! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need an application? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rafaelfranca Yes. it needs the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are running
bundle exec rake
and rake isn't part of the Gemfile. Perhaps, add both rake and rubocop as dependencies of the Gem.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.