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

Fix scenario selection #786

Merged
merged 3 commits into from
Dec 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
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/cucumber/file_specs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def locations
end

def files
@file_specs.map(&:file)
@file_specs.map(&:file).uniq
end

class FileSpec
Expand Down
12 changes: 10 additions & 2 deletions spec/cucumber/file_specs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Cucumber
describe FileSpecs do
let(:file_specs) { FileSpecs.new(["features/foo.feature:1:2:3", "features/bar.feature:4:5:6"]) }
let(:locations) { file_specs.locations }
let(:files) { file_specs.files }

it "parses locations from multiple files" do
expect(locations.length).to eq 6
Expand All @@ -18,15 +19,22 @@ module Cucumber
end

it "parses file names from multiple file specs" do
files = file_specs.files

expect(files.length).to eq 2
expect(files).to eq [
"features/foo.feature",
"features/bar.feature",
]
end

context "when files are not unique" do
let(:file_specs) { FileSpecs.new(["features/foo.feature:4", "features/foo.feature:34"]) }

it "parses unique file names" do
expect(files.length).to eq 1
expect(files).to eq ["features/foo.feature"]
end
end

context "when no line number is specified" do
let(:file_specs) { FileSpecs.new(["features/foo.feature", "features/bar.feature:34"]) }

Expand Down