Skip to content

Commit

Permalink
Merge pull request #197 from cucumber/gherkin-13
Browse files Browse the repository at this point in the history
Update Gherkin to v13, messages to v12
  • Loading branch information
vincent-psarga committed Apr 15, 2020
2 parents 7e53ca9 + 15ec8c3 commit 7bb5e0f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 25 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Expand Up @@ -9,8 +9,8 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
### Changed

* Updated monorepo libraries:
- cucumber-gherkin ~> 12
- cucumber-messages ~> 11
- cucumber-gherkin ~> 13
- cucumber-messages ~> 12

### Removed

Expand Down
4 changes: 2 additions & 2 deletions cucumber-core.gemspec
Expand Up @@ -22,8 +22,8 @@ Gem::Specification.new do |s|
'source_code_uri' => 'https://github.com/cucumber/cucumber-ruby-core',
}

s.add_dependency 'cucumber-gherkin', '~> 12.0', '>= 12.0.0'
s.add_dependency 'cucumber-messages', '~> 11.1', '>= 11.1.1'
s.add_dependency 'cucumber-gherkin', '~> 13.0', '>= 13.0.0'
s.add_dependency 'cucumber-messages', '~> 12.0', '>= 12.0.0'
s.add_dependency 'cucumber-tag-expressions', '~> 2.0', '>= 2.0.4'

s.add_development_dependency 'coveralls', '~> 0.8', '>= 0.8.23'
Expand Down
5 changes: 2 additions & 3 deletions lib/cucumber/core/gherkin/parser.rb
Expand Up @@ -25,9 +25,8 @@ def document(document)
event_bus.gherkin_source_parsed(message.gherkin_document)
elsif !message.pickle.nil?
receiver.pickle(message.pickle)
elsif !message.attachment.nil?
# Parse error
raise Core::Gherkin::ParseError.new("#{document.uri}: #{message.attachment.body}")
elsif message.parse_error
raise Core::Gherkin::ParseError.new("#{document.uri}: #{message.parse_error.message}")
else
raise "Unknown message: #{message.to_hash}"
end
Expand Down
24 changes: 12 additions & 12 deletions lib/cucumber/core/test/result.rb
Expand Up @@ -44,8 +44,8 @@ def with_filtered_backtrace(filter)
end

def to_message
Cucumber::Messages::TestStepResult.new(
status: Cucumber::Messages::TestStepResult::Status::UNKNOWN,
Cucumber::Messages::TestStepFinished::TestStepResult.new(
status: Cucumber::Messages::TestStepFinished::TestStepResult::Status::UNKNOWN,
duration: UnknownDuration.new.to_message_duration
)
end
Expand Down Expand Up @@ -75,8 +75,8 @@ def to_s
end

def to_message
Cucumber::Messages::TestStepResult.new(
status: Cucumber::Messages::TestStepResult::Status::PASSED,
Cucumber::Messages::TestStepFinished::TestStepResult.new(
status: Cucumber::Messages::TestStepFinished::TestStepResult::Status::PASSED,
duration: duration.to_message_duration
)
end
Expand Down Expand Up @@ -128,8 +128,8 @@ def to_message
message = ""
end

Cucumber::Messages::TestStepResult.new(
status: Cucumber::Messages::TestStepResult::Status::FAILED,
Cucumber::Messages::TestStepFinished::TestStepResult.new(
status: Cucumber::Messages::TestStepFinished::TestStepResult::Status::FAILED,
duration: duration.to_message_duration,
message: message
)
Expand Down Expand Up @@ -216,8 +216,8 @@ def to_s
end

def to_message
Cucumber::Messages::TestStepResult.new(
status: Cucumber::Messages::TestStepResult::Status::UNDEFINED,
Cucumber::Messages::TestStepFinished::TestStepResult.new(
status: Cucumber::Messages::TestStepFinished::TestStepResult::Status::UNDEFINED,
duration: duration.to_message_duration
)
end
Expand All @@ -241,8 +241,8 @@ def to_s
end

def to_message
Cucumber::Messages::TestStepResult.new(
status: Cucumber::Messages::TestStepResult::Status::SKIPPED,
Cucumber::Messages::TestStepFinished::TestStepResult.new(
status: Cucumber::Messages::TestStepFinished::TestStepResult::Status::SKIPPED,
duration: duration.to_message_duration
)
end
Expand All @@ -266,8 +266,8 @@ def to_s
end

def to_message
Cucumber::Messages::TestStepResult.new(
status: Cucumber::Messages::TestStepResult::Status::PENDING,
Cucumber::Messages::TestStepFinished::TestStepResult.new(
status: Cucumber::Messages::TestStepFinished::TestStepResult::Status::PENDING,
duration: duration.to_message_duration
)
end
Expand Down
12 changes: 6 additions & 6 deletions spec/cucumber/core/test/result_spec.rb
Expand Up @@ -25,7 +25,7 @@ module Cucumber::Core::Test

it "converts to a Cucumber::Message::TestResult" do
message = result.to_message
expect(message.status).to eq(Cucumber::Messages::TestStepResult::Status::PASSED)
expect(message.status).to eq(Cucumber::Messages::TestStepFinished::TestStepResult::Status::PASSED)
end

it "has a duration" do
Expand Down Expand Up @@ -75,7 +75,7 @@ module Cucumber::Core::Test

it "converts to a Cucumber::Message::TestResult" do
message = result.to_message
expect(message.status).to eq(Cucumber::Messages::TestStepResult::Status::FAILED)
expect(message.status).to eq(Cucumber::Messages::TestStepFinished::TestStepResult::Status::FAILED)
end

it "requires both constructor arguments" do
Expand Down Expand Up @@ -144,7 +144,7 @@ module Cucumber::Core::Test

it "converts to a Cucumber::Message::TestResult" do
message = result.to_message
expect(message.status).to eq(Cucumber::Messages::TestStepResult::Status::UNKNOWN)
expect(message.status).to eq(Cucumber::Messages::TestStepFinished::TestStepResult::Status::UNKNOWN)
end
end

Expand Down Expand Up @@ -207,7 +207,7 @@ module Cucumber::Core::Test

it "converts to a Cucumber::Message::TestResult" do
message = result.to_message
expect(message.status).to eq(Cucumber::Messages::TestStepResult::Status::UNDEFINED)
expect(message.status).to eq(Cucumber::Messages::TestStepFinished::TestStepResult::Status::UNDEFINED)
end

specify { expect( result.to_sym ).to eq :undefined }
Expand Down Expand Up @@ -236,7 +236,7 @@ module Cucumber::Core::Test

it "converts to a Cucumber::Message::TestResult" do
message = result.to_message
expect(message.status).to eq(Cucumber::Messages::TestStepResult::Status::SKIPPED)
expect(message.status).to eq(Cucumber::Messages::TestStepFinished::TestStepResult::Status::SKIPPED)
end

specify { expect( result.to_sym ).to eq :skipped }
Expand All @@ -263,7 +263,7 @@ module Cucumber::Core::Test

it "converts to a Cucumber::Message::TestResult" do
message = result.to_message
expect(message.status).to eq(Cucumber::Messages::TestStepResult::Status::PENDING)
expect(message.status).to eq(Cucumber::Messages::TestStepFinished::TestStepResult::Status::PENDING)
end

specify { expect( result.to_sym ).to eq :pending }
Expand Down

0 comments on commit 7bb5e0f

Please sign in to comment.