spec/lib/builder/source_spec.rb in vx-builder-0.0.10 vs spec/lib/builder/source_spec.rb in vx-builder-0.0.11

- old
+ new

@@ -5,10 +5,11 @@ let(:config) { described_class.from_attributes content } subject { config } its(:attributes) { should be } its(:rvm) { should eq %w{ 2.0.0 } } + its(:gemfile) { should eq %w{ Gemfile } } its(:before_script) { should eq ["echo before_script"] } its(:script) { should eq ["RAILS_ENV=test ls -1 && echo DONE!"] } context "merge" do let(:new_attrs) { { rvm: "replaced" } } @@ -26,10 +27,11 @@ context "(serialization)" do context "build new instance" do let(:expected) { { "rvm" => ["2.0.0"], + "gemfile" => ["Gemfile"], "before_script" => ["echo before_script"], "before_install" => ["echo before_install"], "script" => ["RAILS_ENV=test ls -1 && echo DONE!"], "env" => { "matrix" => [], @@ -48,10 +50,11 @@ end context "from_attributes" do let(:attrs) {{ rvm: "2.0.0", + gemfile: "Gemfile", before_script: "echo before_script", before_install: "echo before_install", script: "RAILS_ENV=test ls -1 && echo DONE!" }} subject { described_class.from_attributes(attrs).attributes } @@ -65,30 +68,30 @@ end end context "to_matrix_s" do subject { config.to_matrix_s } - it { should eq 'rvm:2.0.0' } + it { should eq 'gemfile:Gemfile, rvm:2.0.0' } context "when many items" do before do mock(config).rvm { %w{ 1.9.3 2.0.0 } } mock(config).scala { %w{ 2.10.1 } } end - it { should eq "rvm:1.9.3, scala:2.10.1" } + it { should eq "gemfile:Gemfile, rvm:1.9.3, scala:2.10.1" } end end context "matrix_keys" do subject { config.matrix_keys } - it { should eq("rvm" => "2.0.0") } + it { should eq("rvm" => "2.0.0", "gemfile" => "Gemfile") } context "when many items" do before do mock(config).rvm { %w{ 1.9.3 2.0.0 } } mock(config).scala { %w{ 2.10.1 } } end - it { should eq({"rvm"=>"1.9.3", "scala"=>"2.10.1"}) } + it { should eq({"rvm"=>"1.9.3", "scala"=>"2.10.1", "gemfile" => "Gemfile"}) } end end it "empty attributes must be empty Array" do