Skip to content

Commit

Permalink
Merge pull request #1222 from cucumber/AsciiComments
Browse files Browse the repository at this point in the history
Fix Style/AsciiComments
  • Loading branch information
mxygem authored Jan 8, 2018
2 parents 6ca6b7e + 0d0f0ed commit 631b418
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 44 deletions.
17 changes: 0 additions & 17 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,6 @@ Style/Alias:
Exclude:
- 'lib/cucumber/formatter/ansicolor.rb'

# Offense count: 23
Style/AsciiComments:
Exclude:
- 'lib/cucumber/encoding.rb'
- 'lib/cucumber/events/gherkin_source_read.rb'
- 'lib/cucumber/events/step_activated.rb'
- 'lib/cucumber/events/step_definition_registered.rb'
- 'lib/cucumber/events/test_run_finished.rb'
- 'lib/cucumber/events/test_run_started.rb'
- 'lib/cucumber/events/test_step_started.rb'
- 'lib/cucumber/filters/randomizer.rb'
- 'lib/cucumber/formatter/html.rb'
- 'lib/cucumber/glue/step_definition.rb'
- 'lib/cucumber/running_test_case.rb'
- 'lib/cucumber/runtime.rb'
- 'spec/cucumber/step_match_search_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/Attr:
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo

### Improved

* Fix Lint/HandleExceptions ([#1226](https://github.com/cucumber/cucumber-ruby/pull/1226) [@jaysonesmith](https://github.com/jaysonesmith))
* Fix Style/AlignParameters ([#1221](https://github.com/cucumber/cucumber-ruby/pull/1221) [@jaysonesmith](https://github.com/jaysonesmith))
* Fix Performance/RedundantBlockCall ([#1220](https://github.com/cucumber/cucumber-ruby/pull/1220) [@jaysonesmith](https://github.com/jaysonesmith))
* Fix Style/AlignParameters ([#1221](https://github.com/cucumber/cucumber-ruby/pull/1221) [@jaysonesmith](https://github.com/jaysonesmith))
* Fix Style/AsciiComments ([#1222](https://github.com/cucumber/cucumber-ruby/pull/1222) [@jaysonesmith](https://github.com/jaysonesmith))
* Exclude Style/AsciiIdentifiers ([#1223](https://github.com/cucumber/cucumber-ruby/pull/1223) [@jaysonesmith](https://github.com/jaysonesmith))
* Fix Lint/HandleExceptions ([#1226](https://github.com/cucumber/cucumber-ruby/pull/1226) [@jaysonesmith](https://github.com/jaysonesmith))

## [3.1.0](https://github.com/cucumber/cucumber-ruby/compare/v3.0.2...3.1.0) (2017-11-28)

Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/encoding.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
# See https://github.com/cucumber/cucumber/issues/693
# See https://github.com/cucumber/cucumber/issues/693
if defined? Encoding
Encoding.default_external = 'utf-8'
Encoding.default_internal = 'utf-8'
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/events/gherkin_source_read.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Cucumber
module Events

# Fired after we've read in the contents of a feature file
# Fired after we've read in the contents of a feature file
class GherkinSourceRead < Core::Event.new(:path, :body)

# The path to the file
Expand Down
6 changes: 3 additions & 3 deletions lib/cucumber/events/step_activated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ module Events
# Event fired when a step is activated
class StepActivated < Core::Event.new(:test_step, :step_match)

# The test step that was matched.
# The test step that was matched.
#
# @return [Cucumber::Core::Test::Step]
attr_reader :test_step

# Information about the matching definition.
# Information about the matching definition.
#
# @return [Cucumber::StepMatch]
attr_reader :step_match

# @private
# @private
def initialize(test_step, step_match)
@test_step, @step_match = test_step, step_match
end
Expand Down
4 changes: 2 additions & 2 deletions lib/cucumber/events/step_definition_registered.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
module Cucumber
module Events

# Event fired after each step definition has been registered
# Event fired after each step definition has been registered
class StepDefinitionRegistered < Core::Event.new(:step_definition)


#_The step definition that was just registered.
# The step definition that was just registered.
#
# @return [RbSupport::RbStepDefinition]
attr_reader :step_definition
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/events/test_run_finished.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module Cucumber
module Events

# Event fired after all test cases have finished executing
# Event fired after all test cases have finished executing
class TestRunFinished < Core::Event.new
end

Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/events/test_run_started.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module Cucumber
module Events

# Event fired once all test cases have been filtered before
# Event fired once all test cases have been filtered before
# the first one is executed.
class TestRunStarted < Core::Event.new(:test_cases)

Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/events/test_step_started.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Cucumber
module Events

# Signals that a {Cucumber::Core::Test::Step} is about to be executed
# Signals that a {Cucumber::Core::Test::Step} is about to be executed
class TestStepStarted < Core::Events::TestStepStarted

# @return [Cucumber::Core::Test::Step] the test step to be executed
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/filters/randomizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module Cucumber
module Filters

# Batches up all test cases, randomizes them, and then sends them on
# Batches up all test cases, randomizes them, and then sends them on
class Randomizer
def initialize(seed, receiver=nil)
@receiver = receiver
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/formatter/html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Cucumber
module Formatter
class Html

# TODO: remove coupling to types
# TODO: remove coupling to types
AST_CLASSES = {
Cucumber::Core::Ast::Scenario => 'scenario',
Cucumber::Core::Ast::ScenarioOutline => 'scenario outline'
Expand Down
16 changes: 8 additions & 8 deletions lib/cucumber/glue/step_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def initialize(registry, expression, proc)
# @registry.available_step_definition(regexp_source, location)
end

# @api private
# @api private
def to_hash
type = expression.is_a?(CucumberExpressions::RegularExpression) ? 'regular expression' : 'cucumber expression'
regexp = expression.regexp
Expand All @@ -91,19 +91,19 @@ def to_hash
}
end

# @api private
# @api private
def ==(step_definition)
expression.source == step_definition.expression.source
end

# @api private
# @api private
def arguments_from(step_name)
args = @expression.match(step_name)
# @registry.invoked_step_definition(regexp_source, location) if args
args
end

# @api private
# @api private
# TODO: inline this and step definition just be a value object
def invoke(args)
begin
Expand All @@ -114,12 +114,12 @@ def invoke(args)
end
end

# @api private
# @api private
def backtrace_line
"#{location}:in `#{@expression}'"
end

# @api private
# @api private
def file_colon_line
case @proc
when Proc
Expand All @@ -129,12 +129,12 @@ def file_colon_line
end
end

# The source location where the step defintion can be found
# The source location where the step definition can be found
def location
@location ||= Cucumber::Core::Ast::Location.from_source_location(*@proc.source_location)
end

# @api private
# @api private
def file
@file ||= location.file
end
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/running_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'delegate'

module Cucumber
# Represents the current status of a running test case.
# Represents the current status of a running test case.
#
# This wraps a `Cucumber::Core::Test::Case` and delegates
# many methods to that object.
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def filters
filters << Cucumber::Core::Test::NameFilter.new(name_regexps)
filters << Cucumber::Core::Test::LocationsFilter.new(filespecs.locations)
filters << Filters::Randomizer.new(@configuration.seed) if @configuration.randomize?
# TODO: can we just use Glue::RegistryAndMore's step definitions directly?
# TODO: can we just use Glue::RegistryAndMore's step definitions directly?
step_match_search = StepMatchSearch.new(@support_code.registry.method(:step_matches), @configuration)
filters << Filters::ActivateSteps.new(step_match_search, @configuration)
@configuration.filters.each do |filter|
Expand Down
6 changes: 3 additions & 3 deletions spec/cucumber/step_match_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ module Cucumber
let(:search) { StepMatchSearch.new(registry.method(:step_matches), configuration) }
let(:registry) { Glue::RegistryAndMore.new(runtime, configuration) }
let(:runtime) do
# TODO: break out step definitions collection from Glue::RegistryAndMore so we don't need this
# TODO: break out step definitions collection from Glue::RegistryAndMore so we don't need this
:unused
end
let(:configuration) { Configuration.new(options) }
let(:options) { {} }
let(:dsl) do
# TODO: stop relying on implicit global state
# TODO: stop relying on implicit global state
registry
Object.new.extend(Glue::Dsl)
end
Expand Down Expand Up @@ -102,7 +102,7 @@ module Cucumber
end
end

# TODO: remove this - it's ... redundant
# TODO: remove this - it's ... redundant
# http://railsforum.com/viewtopic.php?pid=93881
it "does not raise Redundant unless it's really redundant" do
dsl.Given(/^(.*) (.*) user named '(.*)'$/) {|a,b,c|}
Expand Down

0 comments on commit 631b418

Please sign in to comment.