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