forked from tricknotes/ember-cli-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate empty
yarn.lock
using Yarn on Heroku
Closes [tricknotes#538]. Related to [tricknotes#297]. Generate an empty `yarn.lock` so that Heroku understands that the application's deployment target requires `yarn`. [tricknotes#538]: tricknotes#538 [tricknotes#297]: tricknotes#297
- Loading branch information
1 parent
c11588e
commit ca36543
Showing
10 changed files
with
107 additions
and
6 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
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
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
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 @@ | ||
|
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,43 @@ | ||
require "rails/generators" | ||
require "generator_spec" | ||
require "generators/ember/heroku/heroku_generator" | ||
|
||
describe EmberCli::HerokuGenerator, type: :generator do | ||
destination Rails.root.join("tmp", "generator_test_output") | ||
|
||
context "without yarn enabled" do | ||
it "does not generate a root-level yarn.lock" do | ||
EmberCli.configure { |c| c.app "my-app", yarn: false } | ||
setup_destination | ||
|
||
run_generator | ||
|
||
expect(destination_root).to have_structure { | ||
no_file "yarn.lock" | ||
} | ||
end | ||
end | ||
|
||
context "with yarn enabled" do | ||
it "generates a root-level yarn.lock" do | ||
EmberCli.configure { |c| c.app "my-app", yarn: true } | ||
setup_destination | ||
|
||
run_generator | ||
|
||
expect(destination_root).to have_structure { | ||
file "yarn.lock" | ||
} | ||
end | ||
end | ||
|
||
def setup_destination | ||
prepare_destination | ||
|
||
create_empty_gemfile_for_bundler | ||
end | ||
|
||
def create_empty_gemfile_for_bundler | ||
FileUtils.touch(destination_root.join("Gemfile")) | ||
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 @@ | ||
describe EmberCli do | ||
describe ".any?" do | ||
it "delegates to the collection of applications" do | ||
allow(EmberCli).to receive(:apps).and_return( | ||
with_foo: { foo: true }, | ||
witout_foo: { foo: false }, | ||
) | ||
|
||
any_with_foo = EmberCli.any? { |options| options.fetch(:foo) } | ||
|
||
expect(any_with_foo).to be true | ||
end | ||
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