Skip to content

Commit

Permalink
update specs to expect flattened/compacted array
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkarns committed Nov 19, 2015
1 parent b7b86fb commit a65ac08
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions spec/cucumber/rake/task_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ module Rake
let(:profile) { "fancy" }

it "should combine opts and profile into an array, prepending --profile option" do
expect(subject.cucumber_opts_with_profile).to eq [ %w[ foo bar ], "--profile", "fancy" ]
expect(subject.cucumber_opts_with_profile).to eq %w[ foo bar --profile fancy ]
end
end

context "with multiple profiles" do
let(:profile) { %w[ fancy pants ] }

it "should combine opts and profile into an array, prepending --profile option" do
expect(subject.cucumber_opts_with_profile).to eq [ %w[ foo bar ], "--profile", "fancy", "--profile", "pants" ]
it "should combine opts and each profile into an array, prepending --profile option" do
expect(subject.cucumber_opts_with_profile).to eq %w[ foo bar --profile fancy --profile pants ]
end
end
end
Expand All @@ -60,24 +60,22 @@ module Rake
context "without profile" do
let(:profile) { nil }

it "should return just cucumber_opts" do
expect(subject.cucumber_opts_with_profile).to be opts
end
it { expect(subject.cucumber_opts_with_profile).to eq [] }
end

context "with profile" do
let(:profile) { "fancy" }

it "should combine opts and profile into an array, prepending --profile option" do
expect(subject.cucumber_opts_with_profile).to eq [ nil, "--profile", "fancy" ]
expect(subject.cucumber_opts_with_profile).to eq %w[ --profile fancy ]
end
end

context "with multiple profiles" do
let(:profile) { %w[ fancy pants ] }

it "should combine opts and profile into an array, prepending --profile option" do
expect(subject.cucumber_opts_with_profile).to eq [ nil, "--profile", "fancy", "--profile", "pants" ]
it "should combine opts and each profile into an array, prepending --profile option" do
expect(subject.cucumber_opts_with_profile).to eq %w[ --profile fancy --profile pants ]
end
end
end
Expand Down

0 comments on commit a65ac08

Please sign in to comment.