2020-10-10 14:16:11 +02:00
|
|
|
# typed: false
|
2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-09-06 08:29:14 +02:00
|
|
|
describe Cask::DSL::Appcast do
|
2021-01-31 13:14:23 -05:00
|
|
|
subject(:appcast) { described_class.new(url, params) }
|
2017-06-01 04:26:55 -03:00
|
|
|
|
2018-11-28 20:51:55 +01:00
|
|
|
let(:url) { "https://brew.sh" }
|
2017-10-03 08:29:20 +02:00
|
|
|
let(:uri) { URI(url) }
|
2017-06-01 04:26:55 -03:00
|
|
|
let(:params) { {} }
|
|
|
|
|
|
|
|
describe "#to_s" do
|
|
|
|
it "returns the parsed URI string" do
|
2021-01-31 13:14:23 -05:00
|
|
|
expect(appcast.to_s).to eq("https://brew.sh")
|
2017-06-01 04:26:55 -03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "#to_yaml" do
|
|
|
|
let(:yaml) { [uri, params].to_yaml }
|
|
|
|
|
|
|
|
context "with empty parameters" do
|
|
|
|
it "returns an YAML serialized array composed of the URI and parameters" do
|
2021-01-31 13:14:23 -05:00
|
|
|
expect(appcast.to_yaml).to eq(yaml)
|
2017-06-01 04:26:55 -03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|