From 1c7238e59ba49e8c86c9830fa43d4007d24f6e83 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 30 Apr 2017 21:18:06 +0200 Subject: Add tests for `PATH#select` and `PATH#reject`. --- Library/Homebrew/test/PATH_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Library/Homebrew/test/PATH_spec.rb') 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) -- cgit v1.2.3