Skip to content

Commit

Permalink
Merge pull request #786 from jdks/fix-scenario-selection
Browse files Browse the repository at this point in the history
Fix #778
  • Loading branch information
mattwynne committed Dec 30, 2014
2 parents dd9c268 + be5f620 commit a8050ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/cucumber/file_specs.rb
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
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

0 comments on commit a8050ee

Please sign in to comment.