Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for multiple suites through options #511

Merged
merged 3 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/teaspoon/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,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 @@ -121,6 +121,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(foo bar))

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").
Expand Down