spec/lib/builder/source_matrix_spec.rb in vx-builder-0.0.2 vs spec/lib/builder/source_matrix_spec.rb in vx-builder-0.0.3
- old
+ new
@@ -5,10 +5,11 @@
let(:attributes) { {
env: %w{ FOO=1 BAR=2 },
rvm: %w{ 1.8.7 1.9.3 2.0.0 },
scala: %w{ 2.9.2 2.10.1 },
before_script: "echo before_script",
+ before_install: "echo before_install",
script: "echo script"
} }
let(:config) { Vx::Builder::Source.from_attributes attributes }
let(:matrix) { described_class.new config }
@@ -30,17 +31,21 @@
context 'configurations' do
subject { matrix.configurations }
it "should copy script from source" do
- expect(subject.map(&:script).uniq).to eq [["echo script"]]
+ expect(subject.map(&:script).flatten).to eq ["echo script"] * 12
end
it "should copy before_script from source" do
- expect(subject.map(&:before_script).uniq).to eq [["echo before_script"]]
+ expect(subject.map(&:before_script).flatten).to eq ["echo before_script"] * 12
end
+ it "should copy before_install from source" do
+ expect(subject.map(&:before_install).flatten).to eq ["echo before_install"] * 12
+ end
+
context "without any matrix keys" do
let(:attributes) { {
script: %w{ /bin/true },
} }
@@ -48,12 +53,13 @@
its("first.attributes") { should eq(
"env" => {
"matrix" => [],
"global" => []
},
- "script" =>["/bin/true"],
- "before_script" =>[],
- "services" => []
+ "script" =>["/bin/true"],
+ "before_script" =>[],
+ "services" => [],
+ "before_install" => []
)}
end
context "with one env and one rvm key" do
let(:config) { Vx::Builder::Source.from_file fixture_path("travis_bug_1.yml") }