mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
shell_command_spec: fix and simplify tests
This commit is contained in:
parent
2b7785a64d
commit
c0053cdbfb
1 changed files with 4 additions and 11 deletions
|
@ -61,13 +61,13 @@ describe Pry::Command::ShellCommand do
|
||||||
describe "with CDPATH" do
|
describe "with CDPATH" do
|
||||||
let(:cdpath) { File.expand_path(File.join('spec', 'fixtures', 'cdpathdir')) }
|
let(:cdpath) { File.expand_path(File.join('spec', 'fixtures', 'cdpathdir')) }
|
||||||
let(:nonexisting_path) { File.expand_path('nonexisting_path') }
|
let(:nonexisting_path) { File.expand_path('nonexisting_path') }
|
||||||
|
let(:long_cdpath) {
|
||||||
let(:long_cdpath) { [nonexisting_path, cdpath].join(File::SEPARATOR) }
|
[nonexisting_path, cdpath].join(File::PATH_SEPARATOR)
|
||||||
let(:bad_cdpath) { 'asdfgh' }
|
}
|
||||||
|
|
||||||
describe "when it is defined" do
|
describe "when it is defined" do
|
||||||
before do
|
before do
|
||||||
@stub = allow_any_instance_of(described_class).to receive(:cd_path)
|
@stub = allow_any_instance_of(described_class).to receive(:cd_path_env)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "simple cdpath" do
|
describe "simple cdpath" do
|
||||||
|
@ -86,13 +86,6 @@ describe Pry::Command::ShellCommand do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "when it is missing" do
|
|
||||||
it "performs default directory lookup" do
|
|
||||||
expect(Dir).to receive(:chdir).with(nonexisting_path)
|
|
||||||
pry_eval '.cd nonexisting_path'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue