From 8155d27e5c11f9d0adfbb6c911d1c5d6b479aa53 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 8 Feb 2017 10:09:00 +0100 Subject: [PATCH] Convert Pre/PostflightBlock test to spec. --- .../cask/artifact/postflight_block_spec.rb} | 18 +++++++++--------- .../cask/artifact/preflight_block_spec.rb} | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) rename Library/Homebrew/cask/{test/cask/artifact/postflight_block_test.rb => spec/cask/artifact/postflight_block_spec.rb} (64%) rename Library/Homebrew/cask/{test/cask/artifact/preflight_block_test.rb => spec/cask/artifact/preflight_block_spec.rb} (64%) diff --git a/Library/Homebrew/cask/test/cask/artifact/postflight_block_test.rb b/Library/Homebrew/cask/spec/cask/artifact/postflight_block_spec.rb similarity index 64% rename from Library/Homebrew/cask/test/cask/artifact/postflight_block_test.rb rename to Library/Homebrew/cask/spec/cask/artifact/postflight_block_spec.rb index 47dcdd905b..6f58afb2ad 100644 --- a/Library/Homebrew/cask/test/cask/artifact/postflight_block_test.rb +++ b/Library/Homebrew/cask/spec/cask/artifact/postflight_block_spec.rb @@ -1,9 +1,9 @@ -require "test_helper" +require "spec_helper" describe Hbc::Artifact::PostflightBlock do describe "install_phase" do it "calls the specified block after installing, passing a Cask mini-dsl" do - called = false + called = false yielded_arg = nil cask = Hbc::Cask.new("with-postflight") do @@ -13,16 +13,16 @@ describe Hbc::Artifact::PostflightBlock do end end - Hbc::Artifact::PostflightBlock.new(cask).install_phase + described_class.new(cask).install_phase - called.must_equal true - yielded_arg.must_be_kind_of Hbc::DSL::Postflight + expect(called).to be true + expect(yielded_arg).to be_kind_of(Hbc::DSL::Postflight) end end describe "uninstall_phase" do it "calls the specified block after uninstalling, passing a Cask mini-dsl" do - called = false + called = false yielded_arg = nil cask = Hbc::Cask.new("with-uninstall-postflight") do @@ -32,10 +32,10 @@ describe Hbc::Artifact::PostflightBlock do end end - Hbc::Artifact::PostflightBlock.new(cask).uninstall_phase + described_class.new(cask).uninstall_phase - called.must_equal true - yielded_arg.must_be_kind_of Hbc::DSL::UninstallPostflight + expect(called).to be true + expect(yielded_arg).to be_kind_of(Hbc::DSL::UninstallPostflight) end end end diff --git a/Library/Homebrew/cask/test/cask/artifact/preflight_block_test.rb b/Library/Homebrew/cask/spec/cask/artifact/preflight_block_spec.rb similarity index 64% rename from Library/Homebrew/cask/test/cask/artifact/preflight_block_test.rb rename to Library/Homebrew/cask/spec/cask/artifact/preflight_block_spec.rb index 440b1db3a4..ac5313bcae 100644 --- a/Library/Homebrew/cask/test/cask/artifact/preflight_block_test.rb +++ b/Library/Homebrew/cask/spec/cask/artifact/preflight_block_spec.rb @@ -1,9 +1,9 @@ -require "test_helper" +require "spec_helper" describe Hbc::Artifact::PreflightBlock do describe "install_phase" do it "calls the specified block before installing, passing a Cask mini-dsl" do - called = false + called = false yielded_arg = nil cask = Hbc::Cask.new("with-preflight") do @@ -13,16 +13,16 @@ describe Hbc::Artifact::PreflightBlock do end end - Hbc::Artifact::PreflightBlock.new(cask).install_phase + described_class.new(cask).install_phase - called.must_equal true - yielded_arg.must_be_kind_of Hbc::DSL::Preflight + expect(called).to be true + expect(yielded_arg).to be_kind_of Hbc::DSL::Preflight end end describe "uninstall_phase" do it "calls the specified block before uninstalling, passing a Cask mini-dsl" do - called = false + called = false yielded_arg = nil cask = Hbc::Cask.new("with-uninstall-preflight") do @@ -32,10 +32,10 @@ describe Hbc::Artifact::PreflightBlock do end end - Hbc::Artifact::PreflightBlock.new(cask).uninstall_phase + described_class.new(cask).uninstall_phase - called.must_equal true - yielded_arg.must_be_kind_of Hbc::DSL::UninstallPreflight + expect(called).to be true + expect(yielded_arg).to be_kind_of Hbc::DSL::UninstallPreflight end end end