spec/integration/ruby_spec.rb in vx-builder-0.3.1 vs spec/integration/ruby_spec.rb in vx-builder-0.3.2

- old
+ new

@@ -42,23 +42,26 @@ context "deploy" do let(:config) { fixture("integration/ruby/deploy/config.yml") } context "configuration" do - let(:task) { create :task, deploy: true } - let(:source) { Vx::Builder.deploy(matrix, branch: "master").build } - subject { script } + let(:task) { create :task, deploy: true } + let(:sources) { Vx::Builder.deploy(matrix, branch: "master").build } - before { write_script_to_filter "deploy/d." } - it "should have source" do - expect(source).to be + expect(sources).to have(1).item end - its(:to_before_script) { should eq fixture("integration/ruby/deploy/d.before_script.sh") } - its(:to_script) { should eq fixture("integration/ruby/deploy/d.script.sh") } - its(:to_after_script) { should eq fixture("integration/ruby/deploy/d.after_script.sh") } + context "first deploy configuration" do + let(:source) { sources.first } + before { write_script_to_filter "deploy/d." } + subject { script } + + its(:to_before_script) { should eq fixture("integration/ruby/deploy/d.before_script.sh") } + its(:to_script) { should eq fixture("integration/ruby/deploy/d.script.sh") } + its(:to_after_script) { should eq fixture("integration/ruby/deploy/d.after_script.sh") } + end end end context "matrix" do let(:config) { fixture("integration/ruby/matrix/config.yml") } @@ -86,22 +89,24 @@ its(:to_script) { should eq fixture("integration/ruby/matrix/1.script.sh") } its(:to_after_script) { should eq fixture("integration/ruby/matrix/1.after_script.sh") } end context "deploy configuration" do - let(:task) { create :task } - let(:source) { Vx::Builder.deploy(matrix, branch: "master").build } - subject { script } + let(:task) { create :task } + let(:sources) { Vx::Builder.deploy(matrix, branch: "master").build } - before { write_script_to_filter "matrix/d." } - it "should have source" do - expect(source).to be + expect(sources).to have(1).item end - its(:to_before_script) { should eq fixture("integration/ruby/matrix/d.before_script.sh") } - its(:to_script) { should eq fixture("integration/ruby/matrix/d.script.sh") } - its(:to_after_script) { should eq fixture("integration/ruby/matrix/d.after_script.sh") } + context "first deploy configuration" do + let(:source) { sources.first } + subject { script } + before { write_script_to_filter "matrix/d." } + its(:to_before_script) { should eq fixture("integration/ruby/matrix/d.before_script.sh") } + its(:to_script) { should eq fixture("integration/ruby/matrix/d.script.sh") } + its(:to_after_script) { should eq fixture("integration/ruby/matrix/d.after_script.sh") } + end end end end