-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #259 from kimquy/setup_test_with_initial_test_cases
Setup test with initial test cases
- Loading branch information
Showing
6 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
source "https://rubygems.org" | ||
|
||
gemspec | ||
|
||
gem "rails" | ||
gem "rake", ">= 11.1" | ||
gem "rubocop", ">= 0.47", require: false | ||
|
||
group :test do | ||
gem "minitest", "~> 5.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_equal Webpacker::Env.current, "production" | ||
end | ||
|
||
def test_env_is_development? | ||
refute_predicate Webpacker::Env, :development? | ||
end | ||
|
||
def test_file_path | ||
correct_path = File.join(File.dirname(__FILE__), "config", "webpack", "paths.yml").to_s | ||
assert_equal Webpacker::Env.file_path.to_s, correct_path | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |