Sha256: eb9126674dc172ac308d08717407373520dbdd7429ed8100d314f82bb563bbe2

Contents?: true

Size: 1.06 KB

Versions: 45

Compression:

Stored size: 1.06 KB

Contents

require "spec_helper"
require "middleman-hashicorp/releases"

describe Middleman::HashiCorp::Releases do
  context "when the product does not exist" do
    it "returns an error" do
      expect {
        described_class.fetch("nope", "")
      }.to raise_error(OpenURI::HTTPError)
    end
  end

  context "when the version does not exist" do
    it "returns an error" do
      expect {
        described_class.fetch("vagrant", "0.0.0")
      }.to raise_error(OpenURI::HTTPError)
    end
  end

  it "returns the JSON representation of the version" do
    r = described_class.fetch("consul", "0.1.0")
    expect(r["darwin"]).to eq(
      "amd64" => "https://releases.hashicorp.com/consul/0.1.0/consul_0.1.0_darwin_amd64.zip",
    )
    expect(r["linux"]).to eq(
      "386" => "https://releases.hashicorp.com/consul/0.1.0/consul_0.1.0_linux_386.zip",
      "amd64" => "https://releases.hashicorp.com/consul/0.1.0/consul_0.1.0_linux_amd64.zip",
    )
    expect(r["windows"]).to eq(
      "386" => "https://releases.hashicorp.com/consul/0.1.0/consul_0.1.0_windows_386.zip",
    )
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
middleman-hashicorp-0.3.47 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.46 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.45 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.44 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.43 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.41 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.40 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.39 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.38 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.37 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.35 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.34 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.33 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.32 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.31 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.30 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.29 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.28 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.26 spec/unit/releases_spec.rb
middleman-hashicorp-0.3.25 spec/unit/releases_spec.rb