aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/PATH_spec.rb
diff options
context:
space:
mode:
authorMarkus Reiter2017-04-30 21:18:06 +0200
committerMarkus Reiter2017-04-30 21:18:06 +0200
commit1c7238e59ba49e8c86c9830fa43d4007d24f6e83 (patch)
tree5d4ed82b9c2aecf7211fdefd6865cac72fd78361 /Library/Homebrew/test/PATH_spec.rb
parent005f165dcb3cce388ef6215ed0ed2be775f1f336 (diff)
downloadbrew-1c7238e59ba49e8c86c9830fa43d4007d24f6e83.tar.bz2
Add tests for `PATH#select` and `PATH#reject`.
Diffstat (limited to 'Library/Homebrew/test/PATH_spec.rb')
-rw-r--r--Library/Homebrew/test/PATH_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/Library/Homebrew/test/PATH_spec.rb b/Library/Homebrew/test/PATH_spec.rb
index 409819a17..b20a3d3ac 100644
--- a/Library/Homebrew/test/PATH_spec.rb
+++ b/Library/Homebrew/test/PATH_spec.rb
@@ -86,6 +86,18 @@ describe PATH do
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
it "returns a new PATH without non-existent paths" do
allow(File).to receive(:directory?).with("/path1").and_return(true)