Convert caveats test to spec.
This commit is contained in:
parent
59668d2710
commit
ba61d3ca6b
@ -1,4 +1,4 @@
|
|||||||
require "test_helper"
|
require "spec_helper"
|
||||||
|
|
||||||
describe Hbc::DSL::Caveats do
|
describe Hbc::DSL::Caveats do
|
||||||
let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/basic-cask.rb") }
|
let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/basic-cask.rb") }
|
||||||
@ -17,7 +17,7 @@ $LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.join("cask", "lib").to_s)
|
|||||||
|
|
||||||
require "test/support/helper/shutup"
|
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"
|
require "hbc"
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
@ -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
|
|
||||||
@ -93,7 +93,6 @@ end
|
|||||||
|
|
||||||
# Extend MiniTest API with support for RSpec-style shared examples
|
# Extend MiniTest API with support for RSpec-style shared examples
|
||||||
require "support/shared_examples"
|
require "support/shared_examples"
|
||||||
require "support/shared_examples/dsl_base.rb"
|
|
||||||
require "support/shared_examples/staged.rb"
|
require "support/shared_examples/staged.rb"
|
||||||
|
|
||||||
require "support/fake_dirs"
|
require "support/fake_dirs"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user