Add tests for PATH#select and PATH#reject.
This commit is contained in:
parent
005f165dcb
commit
1c7238e59b
@ -86,6 +86,18 @@ describe PATH do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#select" do
|
||||||
|
it "returns an object of the same class instead of an Array" do
|
||||||
|
expect(described_class.new.select { true }).to be_a(described_class)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "#reject" do
|
||||||
|
it "returns an object of the same class instead of an Array" do
|
||||||
|
expect(described_class.new.reject { true }).to be_a(described_class)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "#existing" do
|
describe "#existing" do
|
||||||
it "returns a new PATH without non-existent paths" do
|
it "returns a new PATH without non-existent paths" do
|
||||||
allow(File).to receive(:directory?).with("/path1").and_return(true)
|
allow(File).to receive(:directory?).with("/path1").and_return(true)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user