summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyrylo Silin <silin@kyrylo.org>2019-06-09 18:25:59 +0300
committerKyrylo Silin <silin@kyrylo.org>2019-06-09 18:27:59 +0300
commit35d181bfac7ec8d6c4f4e4be25e0edc4eddbb01b (patch)
tree1011a8379791a7e5d120003d4e30321513054670
parente5356a4dc87c1f6accf0f6bf889463c37bf331d6 (diff)
downloadpry-35d181bfac7ec8d6c4f4e4be25e0edc4eddbb01b.tar.gz
spec/config: fix flaky test
This spec was failing for me locally (but worked well on Circle). The reason is that `XDG_CONFIG_HOME` is set for me and takes precedence. Therefore, the fix would be to unset it for the test.
-rw-r--r--spec/config_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/config_spec.rb b/spec/config_spec.rb
index 99cce54a..db91f7cb 100644
--- a/spec/config_spec.rb
+++ b/spec/config_spec.rb
@@ -56,14 +56,18 @@ RSpec.describe Pry::Config do
end
end
- context "when ~/.pryrc exists" do
+ context "when ~/.pryrc exists and $XDG_CONFIG_HOME is undefined" do
before do
allow(File).to receive(:exist?)
expect(File).to receive(:exist?)
.with(File.expand_path('~/.pryrc')).and_return(true)
+
+ allow(Pry::Env).to receive(:[])
+ allow(Pry::Env).to receive(:[])
+ .with('XDG_CONFIG_HOME').and_return(nil)
end
- it "defaults ~/.pryrc" do
+ it "defaults to ~/.pryrc" do
expect(subject.rc_file).to eq('~/.pryrc')
end
end