Sha256: 2ff7300b21888fe348b293bc03be1101894783bad70396b38031c198dd094efd

Contents?: true

Size: 1.29 KB

Versions: 13

Compression:

Stored size: 1.29 KB

Contents

require "spec_helper"
require "license_acceptance/strategy/provided_value"

RSpec.describe LicenseAcceptance::Strategy::ProvidedValue do
  let(:acc) { LicenseAcceptance::Strategy::ProvidedValue.new(value) }

  describe "#accepted?" do
    describe "when the value is correct" do
      let(:value) { "accept" }
      it "returns true" do
        expect(acc.accepted?).to eq(true)
      end
    end

    describe "when the value is incorrect" do
      let(:value) { nil }
      it "returns false" do
        expect(acc.accepted?).to eq(false)
      end
    end
  end

  describe "#silent?" do
    describe "when the value is correct" do
      let(:value) { "accept-silent" }
      it "returns true" do
        expect(acc.silent?).to eq(true)
      end
    end

    describe "when the value is incorrect" do
      let(:value) { "accept" }
      it "returns false" do
        expect(acc.silent?).to eq(false)
      end
    end
  end

  describe "#no_persist?" do
    describe "when the value is correct" do
      let(:value) { "accept-no-persist" }
      it "returns true" do
        expect(acc.no_persist?).to eq(true)
      end
    end

    describe "when the value is incorrect" do
      let(:value) { "accept-silent" }
      it "returns false" do
        expect(acc.no_persist?).to eq(false)
      end
    end
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
license-acceptance-1.0.13 spec/license_acceptance/strategy/provided_value_spec.rb
license-acceptance-1.0.12 spec/license_acceptance/strategy/provided_value_spec.rb
license-acceptance-1.0.11 spec/license_acceptance/strategy/provided_value_spec.rb
license-acceptance-1.0.8 spec/license_acceptance/strategy/provided_value_spec.rb
license-acceptance-1.0.7 spec/license_acceptance/strategy/provided_value_spec.rb
license-acceptance-1.0.6 spec/license_acceptance/strategy/provided_value_spec.rb
license-acceptance-1.0.5 spec/license_acceptance/strategy/provided_value_spec.rb
license-acceptance-1.0.3 spec/license_acceptance/strategy/provided_value_spec.rb
license-acceptance-1.0.2 spec/license_acceptance/strategy/provided_value_spec.rb
license-acceptance-1.0.0 spec/license_acceptance/strategy/provided_value_spec.rb
license-acceptance-0.2.16 spec/license_acceptance/strategy/provided_value_spec.rb
license-acceptance-0.2.15 spec/license_acceptance/strategy/provided_value_spec.rb
license-acceptance-0.2.13 spec/license_acceptance/strategy/provided_value_spec.rb