summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyrylo Silin <silin@kyrylo.org>2019-06-09 18:35:25 +0300
committerGitHub <noreply@github.com>2019-06-09 18:35:25 +0300
commitbfc66a12ead879186cd3a5ad7fa8c561096b9ccb (patch)
tree1011a8379791a7e5d120003d4e30321513054670
parente5356a4dc87c1f6accf0f6bf889463c37bf331d6 (diff)
parent35d181bfac7ec8d6c4f4e4be25e0edc4eddbb01b (diff)
downloadpry-bfc66a12ead879186cd3a5ad7fa8c561096b9ccb.tar.gz
Merge pull request #2058 from pry/config-spec-fix
spec/config: fix flaky 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