aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-21 05:00:26 +0100
committerMarkus Reiter2017-02-21 05:00:26 +0100
commit9fc14e663bc52b5e32a4c2d07ed6114b99fcbf54 (patch)
tree802fa888ac12ff1484882b35a422639b452e5939
parentbd0a1314c8a2676a69b81ba840fb7ea6e50ae736 (diff)
downloadbrew-9fc14e663bc52b5e32a4c2d07ed6114b99fcbf54.tar.bz2
Convert GPG2Requirement test to spec.
-rw-r--r--Library/Homebrew/test/gpg2_requirement_spec.rb23
-rw-r--r--Library/Homebrew/test/gpg2_requirement_test.rb25
2 files changed, 23 insertions, 25 deletions
diff --git a/Library/Homebrew/test/gpg2_requirement_spec.rb b/Library/Homebrew/test/gpg2_requirement_spec.rb
new file mode 100644
index 000000000..f46b31196
--- /dev/null
+++ b/Library/Homebrew/test/gpg2_requirement_spec.rb
@@ -0,0 +1,23 @@
+require "requirements/gpg2_requirement"
+require "fileutils"
+
+describe GPG2Requirement do
+ let(:dir) { @dir = Pathname.new(Dir.mktmpdir) }
+
+ after(:each) do
+ FileUtils.rm_rf dir unless @dir.nil?
+ end
+
+ describe "#satisfied?" do
+ it "returns true if GPG2 is installed" do
+ ENV["PATH"] = dir/"bin"
+ (dir/"bin/gpg").write <<-EOS.undent
+ #!/bin/bash
+ echo 2.0.30
+ EOS
+ FileUtils.chmod 0755, dir/"bin/gpg"
+
+ expect(subject).to be_satisfied
+ end
+ end
+end
diff --git a/Library/Homebrew/test/gpg2_requirement_test.rb b/Library/Homebrew/test/gpg2_requirement_test.rb
deleted file mode 100644
index 3297c2851..000000000
--- a/Library/Homebrew/test/gpg2_requirement_test.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require "testing_env"
-require "requirements/gpg2_requirement"
-require "fileutils"
-
-class GPG2RequirementTests < Homebrew::TestCase
- def setup
- super
- @dir = Pathname.new(mktmpdir)
- (@dir/"bin/gpg").write <<-EOS.undent
- #!/bin/bash
- echo 2.0.30
- EOS
- FileUtils.chmod 0755, @dir/"bin/gpg"
- end
-
- def teardown
- FileUtils.rm_rf @dir
- super
- end
-
- def test_satisfied
- ENV["PATH"] = @dir/"bin"
- assert_predicate GPG2Requirement.new, :satisfied?
- end
-end