Skip to content

Commit

Permalink
Merge 0f33f05 into 46a5b28
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-psarga committed Oct 1, 2019
2 parents 46a5b28 + 0f33f05 commit e67caa0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
23 changes: 23 additions & 0 deletions appveyor.yml
@@ -0,0 +1,23 @@
version: '1.0.{build}'

environment:
matrix:
- RUBY_VERSION: 23-x64
- RUBY_VERSION: 24-x64
- RUBY_VERSION: 25-x64
- RUBY_VERSION: 26-x64


install:
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
- bundle install

build: off

before_test:
- ruby -v
- gem -v
- bundle -v

test_script:
- bundle exec rake
7 changes: 5 additions & 2 deletions spec/cucumber/core/test/location_spec.rb
Expand Up @@ -100,14 +100,17 @@ module Cucumber::Core::Test

context "when the location is neither below pwd nor in an installed gem" do
it "use the absolute path to the file" do
expect( Location.from_source_location("/path/file.rb", 1).file ).to eq "/path/file.rb"
# Use File.expand on expectation to ensure tests work on multiple platform.
# On Windows, it will return "C:/path/file.rb" as an absolute path while it will return "/path/file.rb" on Linux.
expect( Location.from_source_location("/path/file.rb", 1).file ).to eq File.expand_path("/path/file.rb")
end
end
end

describe "created from file-colon-line" do
it "handles also Windows paths" do
expect( Location.from_file_colon_line("c:\path\file.rb:123").file ).to eq "c:\path\file.rb"
# Note: running this test on Windows will produce "c:/path/file.rb", but "c:\path\file.rb" on Linux.
expect( Location.from_file_colon_line("c:\\path\\file.rb:123").file ).to match(/c:(\\|\/)path(\\|\/)file.rb/)
end
end

Expand Down

0 comments on commit e67caa0

Please sign in to comment.