Convert caveats test to spec.

This commit is contained in:
Markus Reiter 2017-02-09 03:49:12 +01:00
parent 59668d2710
commit ba61d3ca6b
5 changed files with 25 additions and 26 deletions

View File

@ -1,4 +1,4 @@
require "test_helper"
require "spec_helper"
describe Hbc::DSL::Caveats do
let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/basic-cask.rb") }

View File

@ -17,7 +17,7 @@ $LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.join("cask", "lib").to_s)
require "test/support/helper/shutup"
Pathname.glob(HOMEBREW_LIBRARY_PATH.join("cask", "spec", "support", "*.rb")).each(&method(:require))
Pathname.glob(HOMEBREW_LIBRARY_PATH.join("cask", "spec", "support", "**", "*.rb")).each(&method(:require))
require "hbc"

View File

@ -0,0 +1,23 @@
require "hbc/dsl/base"
shared_examples Hbc::DSL::Base do
it "supports the token method" do
expect(dsl.token).to eq(cask.token)
end
it "supports the version method" do
expect(dsl.version).to eq(cask.version)
end
it "supports the caskroom_path method" do
expect(dsl.caskroom_path).to eq(cask.caskroom_path)
end
it "supports the staged_path method" do
expect(dsl.staged_path).to eq(cask.staged_path)
end
it "supports the appdir method" do
expect(dsl.appdir).to eq(cask.appdir)
end
end

View File

@ -1,23 +0,0 @@
require "test_helper"
shared_examples_for Hbc::DSL::Base do
it "supports the token method" do
dsl.token.must_equal cask.token
end
it "supports the version method" do
dsl.version.must_equal cask.version
end
it "supports the caskroom_path method" do
dsl.caskroom_path.must_equal cask.caskroom_path
end
it "supports the staged_path method" do
dsl.staged_path.must_equal cask.staged_path
end
it "supports the appdir method" do
dsl.appdir.must_equal cask.appdir
end
end

View File

@ -93,7 +93,6 @@ end
# Extend MiniTest API with support for RSpec-style shared examples
require "support/shared_examples"
require "support/shared_examples/dsl_base.rb"
require "support/shared_examples/staged.rb"
require "support/fake_dirs"