-
-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This means using a null object for multiline arguments, which involved quite a few changes. It means we do now have our own wrappers for the DocString and DataTable classes, so we can add back those methods like diff! that people will be looking for.
- Loading branch information
Showing
18 changed files
with
162 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
source "https://rubygems.org" | ||
gemspec | ||
gem 'cucumber-core', path: '../cucumber-ruby-core' if File.dir?('../cucumber-ruby-core') | ||
if ENV['cucumber_dev'] | ||
gem 'cucumber-core', path: '../cucumber-ruby-core' if File.directory?('../cucumber-ruby-core') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
require 'delegate' | ||
module Cucumber | ||
module MultilineArgument | ||
def self.from(core_multiline_arg) | ||
Builder.new(core_multiline_arg).result | ||
end | ||
|
||
class Builder | ||
def initialize(multiline_arg) | ||
multiline_arg.describe_to self | ||
end | ||
|
||
def doc_string(string, *args) | ||
@result = DocString.new(string) | ||
end | ||
|
||
def data_table(table, *args) | ||
@result = DataTable.new(table) | ||
end | ||
|
||
def result | ||
@result || None.new | ||
end | ||
end | ||
|
||
class DocString < SimpleDelegator | ||
def append_to(array) | ||
array << self | ||
end | ||
end | ||
|
||
class DataTable < SimpleDelegator | ||
def append_to(array) | ||
array << self | ||
end | ||
|
||
def to_json(options) | ||
raw.to_json(options) | ||
end | ||
end | ||
|
||
class None | ||
def append_to(array) | ||
end | ||
|
||
def describe_to(visitor) | ||
end | ||
end | ||
|
||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.