Sha256: 1888cbe99346bbe7f210156f8ad751423ea53f77d5a9fdd7ee258d71c1102c71

Contents?: true

Size: 1.18 KB

Versions: 31

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'

describe Vx::Builder::BuildConfiguration::Env do
  let(:params) { { 'matrix' => ['a', 'b'], 'global' => ['c', 'd'] } }
  let(:env)    { described_class.new params }
  subject { env }

  its(:attributes) { should eq("matrix" => ['a', 'b'], "global" => ['c', 'd']) }

  context "attributes" do

    context "when env is string" do
      let(:params) { 'foo' }
      its(:matrix)     { should eq [] }
      its(:global)     { should eq ["foo"] }
    end

    context "when env is array" do
      let(:params) { [:foo, :bar] }
      its(:matrix)     { should eq ['foo', 'bar'] }
      its(:global)     { should eq [] }
    end

    context "when env is array of one element" do
      let(:params) { [:foo] }
      its(:matrix)     { should eq [] }
      its(:global)     { should eq ['foo'] }
    end

    context "when env is valid hash" do
      let(:params) { { "global" => "foo", "matrix" => 'bar' } }
      its(:matrix)     { should eq ['bar'] }
      its(:global)     { should eq ['foo'] }
    end

    context "when env is invalid hash" do
      let(:params) { { "key" => "foo" } }
      its(:matrix)     { should eq [] }
      its(:global)     { should eq [] }
    end

  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
vx-builder-0.5.14 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.13 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.12 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.11 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.10 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.9 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.8 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.7 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.6 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.5 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.4 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.3 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.2 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.1 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.5.0 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.4.0 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.3.14 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.3.13 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.3.12 spec/lib/builder/build_configuration/env_spec.rb
vx-builder-0.3.11 spec/lib/builder/build_configuration/env_spec.rb