Skip to content

Commit 8b2c16f

Browse files
committed
Merge #14 'Adapt to the move of Location to Cucumber::Core::Test'
Also update Changelog.md, cucumber-wire.gemspec and .travis.yml.
2 parents 6395397 + 51ff015 commit 8b2c16f

16 files changed

+68
-34
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ rvm:
33
- 2.4.0
44
- 2.3.3
55
- 2.2
6-
- 2.1
7-
- 2.0
86

97
matrix:
108
allow_failures:

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
1010

1111
----
1212

13-
## [Unreleased] - In Git
13+
## [In Git (targeting 1.0.0)](https://github.com/cucumber/cucumber-ruby-wire/compare/v0.0.1...master)
1414

1515
### Removed
1616

@@ -20,11 +20,15 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
2020

2121
### Changed
2222

23+
* Changes to work with a modern Cucumber-Ruby ([#14](https://github.com/cucumber/cucumber-ruby-wire/pull/14) [brasmusson](https://github.com/brasmusson))
24+
* Adapt to the move of Location to Cucumber::Core::Test ([#14](https://github.com/cucumber/cucumber-ruby-wire/pull/14) [brasmusson](https://github.com/brasmusson))
25+
2326
### Fixed
2427

2528
<!-- Releases -->
2629

2730
<!-- Contributors -->
31+
[brasmusson]: https://github.com/brasmusson
2832
[jaysonesmith]: https://github.com/jaysonesmith
2933
[junaruga]: https://github.com/junaruga
3034
[mattwynne]: https://github.com/mattwynne

cucumber-wire.gemspec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ Gem::Specification.new do |s|
1111
s.homepage = "http://cucumber.io"
1212
s.platform = Gem::Platform::RUBY
1313
s.license = "MIT"
14-
s.required_ruby_version = ">= 1.9.3"
14+
s.required_ruby_version = ">= 2.2"
1515

16-
s.add_development_dependency 'cucumber', '~> 2.1.0'
16+
s.add_dependency 'cucumber-core', '~> 3.2'
17+
s.add_dependency 'cucumber-expressions', '~> 6.0'
18+
19+
s.add_development_dependency 'cucumber', '~> 3.1'
1720

1821
s.add_development_dependency 'bundler', '>= 1.3.5'
1922
s.add_development_dependency 'rake', '>= 0.9.2'

features/invoke_message.feature

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ Feature: Invoke message
4747
4848
Scenario: Wired
4949
Given we're all wired
50-
I'll do it later (Cucumber::Pending)
51-
features/wired.feature:3:in `Given we're all wired'
5250
5351
1 scenario (1 pending)
5452
1 step (1 pending)
@@ -102,7 +100,7 @@ Feature: Invoke message
102100
(::) failed steps (::)
103101
104102
The wires are down (Some.Foreign.ExceptionType from localhost:54321)
105-
features/wired.feature:3:in `Given we're all wired'
103+
features/wired.feature:3:in `we're all wired'
106104
107105
Failing Scenarios:
108106
cucumber features/wired.feature:2 # Scenario: Wired

features/step_matches_message.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Feature: Step matches message
7070
"""
7171
-
7272
73-
we.* # MyApp.MyClass:123
73+
"we.*" # MyApp.MyClass:123
7474
7575
1 scenario (1 skipped)
7676
1 step (1 skipped)

features/table_diffing.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Feature: Wire protocol table diffing
3939
Not same (DifferentException from localhost:54321)
4040
a.cs:12
4141
b.cs:34
42-
features/wired.feature:3:in `Given we're all wired'
42+
features/wired.feature:3:in `we're all wired'
4343
4444
Failing Scenarios:
4545
cucumber features/wired.feature:2
@@ -84,7 +84,7 @@ Feature: Wire protocol table diffing
8484
(::) failed steps (::)
8585
8686
I wanted things to be different for us (Cucumber::Wire::Exception)
87-
features/wired.feature:3:in `Given we're all wired'
87+
features/wired.feature:3:in `we're all wired'
8888
8989
Failing Scenarios:
9090
cucumber features/wired.feature:2
@@ -113,7 +113,7 @@ Feature: Wire protocol table diffing
113113
114114
| (-) a | (+) b |
115115
(Cucumber::MultilineArgument::DataTable::Different)
116-
features/wired.feature:3:in `Given we're all wired'
116+
features/wired.feature:3:in `we're all wired'
117117
118118
Failing Scenarios:
119119
cucumber features/wired.feature:2

features/timeouts.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Feature: Wire protocol timeouts
5252
Scenario: Wired
5353
Given we're all wired
5454
Timed out calling wire server with message 'invoke' (Timeout::Error)
55-
features/wired.feature:3:in `Given we're all wired'
55+
features/wired.feature:3:in `we're all wired'
5656
5757
Failing Scenarios:
5858
cucumber features/wired.feature:2

lib/cucumber/wire/add_hooks_filter.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# coding: utf-8
12
module Cucumber
23
module Wire
34
class AddHooksFilter < Core::Filter.new(:connections)
@@ -10,13 +11,13 @@ def test_case(test_case)
1011
def before_hook(test_case)
1112
# TODO: is this dependency on Cucumber::Hooks OK? Feels a bit internal..
1213
# TODO: how do we express the location of the hook? Should we create one hook per connection so we can use the host:port of the connection?
13-
Cucumber::Hooks.before_hook(test_case.source, Core::Ast::Location.new('TODO:wire')) do
14+
Cucumber::Hooks.before_hook(Core::Test::Location.new('TODO:wire')) do
1415
connections.begin_scenario(test_case)
1516
end
1617
end
1718

1819
def after_hook(test_case)
19-
Cucumber::Hooks.after_hook(test_case.source, Core::Ast::Location.new('TODO:wire')) do
20+
Cucumber::Hooks.after_hook(Core::Test::Location.new('TODO:wire')) do
2021
connections.end_scenario(test_case)
2122
end
2223
end

lib/cucumber/wire/connections.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ class Connections
1616
attr_reader :connections
1717
private :connections
1818

19-
def initialize(connections, configuration)
19+
def initialize(connections, configuration, registry)
2020
raise ArgumentError unless connections
2121
@connections = connections
2222
@configuration = configuration
23+
@registry = registry
2324
end
2425

2526
def find_match(test_step)
@@ -30,7 +31,7 @@ def find_match(test_step)
3031
end
3132

3233
def step_matches(step_name)
33-
connections.map{ |c| c.step_matches(step_name)}.flatten
34+
connections.map{ |c| c.step_matches(step_name, @registry)}.flatten
3435
end
3536

3637
def begin_scenario(test_case)

lib/cucumber/wire/plugin.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
module Cucumber
66
module Wire
77
class Plugin
8-
attr_reader :config
9-
private :config
8+
attr_reader :config, :registry
9+
private :config, :registry
1010

11-
def initialize(config)
11+
def initialize(config, registry)
1212
@config = config
13+
@registry = registry
1314
end
1415

1516
def install
16-
connections = Connections.new(wire_files.map { |f| create_connection(f) }, @config)
17+
connections = Connections.new(wire_files.map { |f| create_connection(f) }, config, registry)
1718
config.filters << Filters::ActivateSteps.new(StepMatchSearch.new(connections.method(:step_matches), @config), @config)
1819
config.filters << AddHooksFilter.new(connections) unless @config.dry_run?
1920
config.register_snippet_generator Snippet::Generator.new(connections)

0 commit comments

Comments
 (0)