1
0
Fork 0
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:
Kyrylo Silin 2015-06-17 16:42:48 +03:00
parent 2b7785a64d
commit c0053cdbfb

View file

@ -61,13 +61,13 @@ describe Pry::Command::ShellCommand do
describe "with CDPATH" do
let(:cdpath) { File.expand_path(File.join('spec', 'fixtures', 'cdpathdir')) }
let(:nonexisting_path) { File.expand_path('nonexisting_path') }
let(:long_cdpath) { [nonexisting_path, cdpath].join(File::SEPARATOR) }
let(:bad_cdpath) { 'asdfgh' }
let(:long_cdpath) {
[nonexisting_path, cdpath].join(File::PATH_SEPARATOR)
}
describe "when it is defined" 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
describe "simple cdpath" do
@ -86,13 +86,6 @@ describe Pry::Command::ShellCommand do
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