Add tests
This commit is contained in:
parent
8be5846c51
commit
b4ed7b9924
36
Library/Homebrew/test/cask/dsl/container_spec.rb
Normal file
36
Library/Homebrew/test/cask/dsl/container_spec.rb
Normal file
@ -0,0 +1,36 @@
|
||||
# typed: false
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "test/cask/dsl/shared_examples/base"
|
||||
|
||||
describe Cask::DSL::Container do
|
||||
subject(:container) { described_class.new(**params) }
|
||||
|
||||
describe "#pairs" do
|
||||
let(:params) { { nested: "NestedApp.dmg" } }
|
||||
|
||||
it "returns the attributes as a hash" do
|
||||
expect(container.pairs).to eq(nested: "NestedApp.dmg")
|
||||
end
|
||||
end
|
||||
|
||||
describe "#to_s" do
|
||||
let(:params) { { nested: "NestedApp.dmg", type: :naked } }
|
||||
|
||||
it "returns the stringified attributes" do
|
||||
expect(container.to_s).to eq('{:nested=>"NestedApp.dmg", :type=>:naked}')
|
||||
end
|
||||
end
|
||||
|
||||
describe "#to_yaml" do
|
||||
let(:params) { { nested: "NestedApp.dmg", type: :naked } }
|
||||
|
||||
it "returns the attributes in YAML format" do
|
||||
expect(container.to_yaml).to eq(<<~YAML)
|
||||
---
|
||||
:nested: NestedApp.dmg
|
||||
:type: :naked
|
||||
YAML
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user