Skip to content

Commit

Permalink
change missing_npm? to missing_yarn?
Browse files Browse the repository at this point in the history
  • Loading branch information
justin808 committed Feb 22, 2017
1 parent 5a2473a commit 4ba9ddf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/generators/react_on_rails/install_generator.rb
Expand Up @@ -60,10 +60,10 @@ def invoke_generators
# js(.coffee) are not checked by this method, but instead produce warning messages
# and allow the build to continue
def installation_prerequisites_met?
!(missing_node? || missing_npm? || ReactOnRails::GitUtils.uncommitted_changes?(GeneratorMessages))
!(missing_node? || missing_yarn? || ReactOnRails::GitUtils.uncommitted_changes?(GeneratorMessages))
end

def missing_npm?
def missing_yarn?
return false unless ReactOnRails::Utils.running_on_windows? ? `where yarn`.blank? : `which yarn`.blank?
error = "yarn is required. Please install it before continuing. "
error << "https://yarnpkg.com/en/docs/install"
Expand Down
8 changes: 4 additions & 4 deletions spec/react_on_rails/generators/install_generator_spec.rb
Expand Up @@ -138,7 +138,7 @@
specify "when npm is exist" do
stub_const("RUBY_PLATFORM", "linux")
allow(@install_generator).to receive(:`).with("which yarn").and_return("/path/to/bin")
expect(@install_generator.send(:missing_npm?)).to eq false
expect(@install_generator.send(:missing_yarn?)).to eq false
end
end

Expand All @@ -154,7 +154,7 @@
specify "when npm is missing" do
stub_const("RUBY_PLATFORM", "linux")
allow(@install_generator).to receive(:`).with("which yarn").and_return("")
expect(@install_generator.send(:missing_npm?)).to eq true
expect(@install_generator.send(:missing_yarn?)).to eq true
end
end

Expand All @@ -170,7 +170,7 @@
specify "when npm is exist" do
stub_const("RUBY_PLATFORM", "mswin")
allow(@install_generator).to receive(:`).with("where yarn").and_return("/path/to/bin")
expect(@install_generator.send(:missing_npm?)).to eq false
expect(@install_generator.send(:missing_yarn?)).to eq false
end
end

Expand All @@ -186,7 +186,7 @@
specify "when npm is missing" do
stub_const("RUBY_PLATFORM", "mswin")
allow(@install_generator).to receive(:`).with("where yarn").and_return("")
expect(@install_generator.send(:missing_npm?)).to eq true
expect(@install_generator.send(:missing_yarn?)).to eq true
end
end
end

0 comments on commit 4ba9ddf

Please sign in to comment.