Skip to content

Commit

Permalink
Adding support for multiple suites through options (#511)
Browse files Browse the repository at this point in the history
* Adding support for multiple suites through options

* flip order

---------

Co-authored-by: Mathieu Jobin <99191+mathieujobin@users.noreply.github.com>
  • Loading branch information
tsov and mathieujobin authored Apr 21, 2023
1 parent d8f350b commit 8f062d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/teaspoon/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def start_server
end

def suites
return [options[:suite]] if options[:suite].present?
return options[:suite].split(',') if options[:suite].present?
return @suites.keys if @suites.present?
Teaspoon.configuration.suite_configs.keys
end
Expand Down
8 changes: 8 additions & 0 deletions spec/teaspoon/console_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@
expect(subject.send(:filter, "foo")).to eq("file[]=file2")
end

it 'resolves suites if multiple are given' do
subject.execute_without_handling(suite: 'bar,foo')
expect(subject.send(:suites)).to eq(%w(bar foo))

subject.execute_without_handling(suite: 'foo')
expect(subject.send(:suites)).to eq(%w(foo))
end

it "resolves the files if a directory was given" do
resolve_spec_for_output = ["test/javascripts/foo.coffee", "test/javascripts/bar.coffee"]
expect(Teaspoon::Suite).to receive(:resolve_spec_for).with("full/path").and_return(
Expand Down

0 comments on commit 8f062d3

Please sign in to comment.