aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/language/node_spec.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/test/language/node_spec.rb b/Library/Homebrew/test/language/node_spec.rb
index 4f2a0df09..68e8326f5 100644
--- a/Library/Homebrew/test/language/node_spec.rb
+++ b/Library/Homebrew/test/language/node_spec.rb
@@ -6,7 +6,7 @@ describe Language::Node do
expect(subject.setup_npm_environment).to be_nil
end
- it "calls prepend_path when npmrc does not exist" do
+ it "calls prepend_path when node formula exists and npmrc does not exist" do
node = formula "node" do
url "node-test"
end
@@ -16,6 +16,11 @@ describe Language::Node do
subject.setup_npm_environment
expect(ENV["PATH"]).to include(Formula["node"].opt_libexec/"bin")
end
+
+ it "does not call prepend_path when node formula does not exist but npmrc exists" do
+ allow_any_instance_of(Pathname).to receive(:exist?).and_return(false)
+ expect(subject.setup_npm_environment).to eq(nil)
+ end
end
describe "#std_npm_install_args" do