diff --git a/.rubocop.yml b/.rubocop.yml index 7123b16790..5304c069c9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,10 @@ inherit_from: .rubocop_todo.yml require: + - rubocop-capybara - rubocop-packaging + - rubocop-rake + - rubocop-rspec AllCops: NewCops: disable diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 12164da3b9..9a60966a4c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,13 +1,13 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2020-08-23 16:54:14 UTC using RuboCop version 0.89.1. +# on 2023-09-01 11:47:49 UTC using RuboCop version 1.43.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. # Offense count: 38 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. # SupportedHashRocketStyles: key, separator, table # SupportedColonStyles: key, separator, table @@ -19,37 +19,343 @@ Layout/HashAlignment: - 'lib/cucumber/formatter/ansicolor.rb' - 'lib/cucumber/gherkin/formatter/ansi_escapes.rb' -# Offense count: 5 -# Cop supports --auto-correct. -Lint/RedundantCopDisableDirective: - Exclude: - - 'lib/cucumber/errors.rb' - - 'lib/cucumber/glue/proto_world.rb' - - 'lib/cucumber/glue/registry_and_more.rb' - - 'lib/cucumber/glue/snippet.rb' - # Offense count: 1 -# Configuration parameters: AllowComments. +# Configuration parameters: AllowComments, AllowNil. Lint/SuppressedException: Exclude: - 'lib/cucumber/rake/task.rb' # Offense count: 1 -# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, Regex, IgnoreExecutableScripts, AllowedAcronyms. +# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms. +# CheckDefinitionPathHierarchyRoots: lib, spec, test, src # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS Naming/FileName: Exclude: - 'features/lib/step_definitions/iso-8859-1_steps.rb' -# Offense count: 197 -# Cop supports --auto-correct. +# Offense count: 2 +RSpec/AnyInstance: + Exclude: + - 'spec/cucumber/cli/main_spec.rb' + +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +RSpec/BeEql: + Exclude: + - 'spec/cucumber/cli/configuration_spec.rb' + - 'spec/cucumber/cli/options_spec.rb' + - 'spec/cucumber/glue/registry_and_more_spec.rb' + +# Offense count: 9 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnabledMethods. +RSpec/Capybara/FeatureMethods: + Exclude: + - 'spec/cucumber/filters/activate_steps_spec.rb' + +# Offense count: 13 +# This cop supports safe autocorrection (--autocorrect). +RSpec/ContextMethod: + Exclude: + - 'spec/cucumber/deprecate_spec.rb' + - 'spec/cucumber/formatter/backtrace_filter_spec.rb' + - 'spec/cucumber/formatter/http_io_spec.rb' + - 'spec/cucumber/formatter/query/hook_by_test_step_spec.rb' + - 'spec/cucumber/formatter/query/pickle_by_test_spec.rb' + - 'spec/cucumber/formatter/query/pickle_step_by_test_step_spec.rb' + - 'spec/cucumber/formatter/query/step_definitions_by_test_step_spec.rb' + - 'spec/cucumber/formatter/query/test_case_started_by_test_case_spec.rb' + - 'spec/cucumber/formatter/url_reporter_spec.rb' + - 'spec/cucumber/term/banner_spec.rb' + +# Offense count: 98 +# Configuration parameters: Prefixes. +# Prefixes: when, with, without +RSpec/ContextWording: + Enabled: false + +# Offense count: 1 +# Configuration parameters: IgnoredMetadata. +RSpec/DescribeClass: + Exclude: + - 'spec/cck/cck_spec.rb' + +# Offense count: 167 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: SkipBlocks, EnforcedStyle. +# SupportedStyles: described_class, explicit +RSpec/DescribedClass: + Enabled: false + +# Offense count: 2 +RSpec/EmptyExampleGroup: + Exclude: + - 'spec/cucumber/filters/activate_steps_spec.rb' + - 'spec/cucumber/running_test_case_spec.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowConsecutiveOneLiners. +RSpec/EmptyLineAfterExample: + Exclude: + - 'spec/cucumber/cli/options_spec.rb' + - 'spec/cucumber/formatter/pretty_spec.rb' + - 'spec/cucumber/multiline_argument/data_table_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +RSpec/EmptyLineAfterExampleGroup: + Exclude: + - 'spec/cucumber/formatter/rerun_spec.rb' + +# Offense count: 10 +# This cop supports safe autocorrection (--autocorrect). +RSpec/EmptyLineAfterFinalLet: + Exclude: + - 'spec/cucumber/cli/main_spec.rb' + - 'spec/cucumber/configuration_spec.rb' + - 'spec/cucumber/formatter/fail_fast_spec.rb' + - 'spec/cucumber/formatter/junit_spec.rb' + - 'spec/cucumber/formatter/pretty_spec.rb' + - 'spec/cucumber/hooks_spec.rb' + - 'spec/cucumber/rake/task_spec.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +RSpec/EmptyLineAfterHook: + Exclude: + - 'spec/cucumber/formatter/junit_spec.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +RSpec/EmptyLineAfterSubject: + Exclude: + - 'spec/cucumber/filters/tag_limits/verifier_spec.rb' + - 'spec/cucumber/hooks_spec.rb' + - 'spec/cucumber/runtime/meta_message_builder_spec.rb' + - 'spec/cucumber/runtime/support_code_spec.rb' + - 'spec/cucumber/runtime_spec.rb' + +# Offense count: 150 +# Configuration parameters: Max. +RSpec/ExampleLength: + Enabled: false + +# Offense count: 51 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: CustomTransform, IgnoredWords. +RSpec/ExampleWording: + Exclude: + - 'spec/cucumber/cli/configuration_spec.rb' + - 'spec/cucumber/multiline_argument/data_table_spec.rb' + - 'spec/cucumber/project_initializer_spec.rb' + - 'spec/cucumber/rake/task_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +RSpec/ExpectActual: + Exclude: + - 'spec/routing/**/*' + - 'spec/cucumber/cli/configuration_spec.rb' + - 'spec/cucumber/step_match_spec.rb' + +# Offense count: 2 +RSpec/ExpectInHook: + Exclude: + - 'spec/cucumber/multiline_argument/data_table_spec.rb' + - 'spec/cucumber/runtime/meta_message_builder_spec.rb' + +# Offense count: 6 +RSpec/ExpectOutput: + Exclude: + - 'spec/cucumber/formatter/interceptor_spec.rb' + +# Offense count: 68 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. -# SupportedStyles: always, always_true, never -Style/FrozenStringLiteralComment: +# SupportedStyles: implicit, each, example +RSpec/HookArgument: Enabled: false +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +RSpec/HooksBeforeExamples: + Exclude: + - 'spec/cucumber/cli/configuration_spec.rb' + - 'spec/cucumber/formatter/interceptor_spec.rb' + +# Offense count: 15 +# Configuration parameters: AssignmentOnly. +RSpec/InstanceVariable: + Exclude: + - 'spec/cucumber/formatter/http_io_spec.rb' + +# Offense count: 1 +RSpec/IteratedExpectation: + Exclude: + - 'spec/cucumber/filters/gated_receiver_spec.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +RSpec/LeadingSubject: + Exclude: + - 'spec/cucumber/cli/main_spec.rb' + - 'spec/cucumber/configuration_spec.rb' + - 'spec/cucumber/formatter/url_reporter_spec.rb' + - 'spec/cucumber/rake/forked_spec.rb' + - 'spec/cucumber/runtime/support_code_spec.rb' + +# Offense count: 59 +# Configuration parameters: EnforcedStyle. +# SupportedStyles: have_received, receive +RSpec/MessageSpies: + Exclude: + - 'spec/cucumber/cli/configuration_spec.rb' + - 'spec/cucumber/cli/main_spec.rb' + - 'spec/cucumber/cli/options_spec.rb' + - 'spec/cucumber/filters/activate_steps_spec.rb' + - 'spec/cucumber/filters/gated_receiver_spec.rb' + - 'spec/cucumber/filters/retry_spec.rb' + - 'spec/cucumber/filters/tag_limits_spec.rb' + - 'spec/cucumber/formatter/interceptor_spec.rb' + - 'spec/cucumber/glue/registry_and_more_spec.rb' + - 'spec/cucumber/glue/step_definition_spec.rb' + - 'spec/cucumber/project_initializer_spec.rb' + - 'spec/cucumber/runtime/meta_message_builder_spec.rb' + - 'spec/cucumber/step_match_search_spec.rb' + - 'spec/cucumber/world/pending_spec.rb' + +# Offense count: 15 +RSpec/MissingExampleGroupArgument: + Exclude: + - 'spec/cucumber/filters/activate_steps_spec.rb' + - 'spec/cucumber/formatter/fail_fast_spec.rb' + - 'spec/cucumber/formatter/rerun_spec.rb' + +# Offense count: 90 +RSpec/MultipleExpectations: + Max: 8 + +# Offense count: 37 +# Configuration parameters: AllowSubject. +RSpec/MultipleMemoizedHelpers: + Max: 15 + +# Offense count: 46 +# Configuration parameters: IgnoreSharedExamples. +RSpec/NamedSubject: + Exclude: + - 'spec/cucumber/cli/main_spec.rb' + - 'spec/cucumber/configuration_spec.rb' + - 'spec/cucumber/formatter/url_reporter_spec.rb' + - 'spec/cucumber/rake/forked_spec.rb' + - 'spec/cucumber/rake/task_spec.rb' + - 'spec/cucumber/runtime/meta_message_builder_spec.rb' + - 'spec/cucumber/runtime/support_code_spec.rb' + - 'spec/cucumber/runtime_spec.rb' + +# Offense count: 6 +RSpec/NestedGroups: + Max: 6 + +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: not_to, to_not +RSpec/NotToNot: + Exclude: + - 'spec/cucumber/filters/gated_receiver_spec.rb' + - 'spec/cucumber/filters/tag_limits/verifier_spec.rb' + - 'spec/cucumber/glue/step_definition_spec.rb' + - 'spec/cucumber/multiline_argument/data_table_spec.rb' + +# Offense count: 4 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers. +# SupportedStyles: inflected, explicit +RSpec/PredicateMatcher: + Exclude: + - 'spec/cucumber/hooks_spec.rb' + - 'spec/cucumber/running_test_case_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +RSpec/ReceiveCounts: + Exclude: + - 'spec/cucumber/filters/retry_spec.rb' + +# Offense count: 8 +RSpec/RepeatedExample: + Exclude: + - 'spec/cucumber/formatter/fail_fast_spec.rb' + - 'spec/cucumber/formatter/rerun_spec.rb' + - 'spec/cucumber/world/pending_spec.rb' + +# Offense count: 2 +RSpec/RepeatedExampleGroupDescription: + Exclude: + - 'spec/cucumber/glue/proto_world_spec.rb' + +# Offense count: 31 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: and_return, block +RSpec/ReturnFromStub: + Exclude: + - 'spec/cucumber/cli/configuration_spec.rb' + - 'spec/cucumber/cli/main_spec.rb' + - 'spec/cucumber/cli/options_spec.rb' + - 'spec/cucumber/cli/profile_loader_spec.rb' + - 'spec/cucumber/cli/rerun_spec.rb' + - 'spec/cucumber/configuration_spec.rb' + - 'spec/cucumber/filters/tag_limits/verifier_spec.rb' + - 'spec/cucumber/formatter/interceptor_spec.rb' + - 'spec/cucumber/formatter/junit_spec.rb' + - 'spec/cucumber/glue/registry_and_more_spec.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +RSpec/ScatteredLet: + Exclude: + - 'spec/cucumber/glue/snippet_spec.rb' + - 'spec/cucumber/runtime/support_code_spec.rb' + +# Offense count: 9 +RSpec/StubbedMock: + Exclude: + - 'spec/cucumber/cli/configuration_spec.rb' + - 'spec/cucumber/formatter/interceptor_spec.rb' + - 'spec/cucumber/glue/registry_and_more_spec.rb' + - 'spec/cucumber/runtime/meta_message_builder_spec.rb' + +# Offense count: 54 +# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames. +RSpec/VerifiedDoubles: + Exclude: + - 'spec/cucumber/cli/main_spec.rb' + - 'spec/cucumber/configuration_spec.rb' + - 'spec/cucumber/filters/activate_steps_spec.rb' + - 'spec/cucumber/filters/gated_receiver_spec.rb' + - 'spec/cucumber/filters/retry_spec.rb' + - 'spec/cucumber/filters/tag_limits/test_case_index_spec.rb' + - 'spec/cucumber/filters/tag_limits/verifier_spec.rb' + - 'spec/cucumber/filters/tag_limits_spec.rb' + - 'spec/cucumber/glue/proto_world_spec.rb' + - 'spec/cucumber/glue/registry_and_more_spec.rb' + - 'spec/cucumber/glue/step_definition_spec.rb' + - 'spec/cucumber/running_test_case_spec.rb' + - 'spec/cucumber/runtime/support_code_spec.rb' + - 'spec/cucumber/world/pending_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Rake/Desc: + Exclude: + - 'gem_tasks/contributors.rake' + - 'gem_tasks/environment.rake' + # Offense count: 5 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: literals, strict Style/MutableConstant: @@ -59,31 +365,10 @@ Style/MutableConstant: - 'lib/cucumber/runtime.rb' - 'lib/cucumber/term/ansicolor.rb' -# Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods. -# SupportedStyles: predicate, comparison -Style/NumericPredicate: - Exclude: - - 'spec/**/*' - - 'lib/cucumber/formatter/console.rb' - - 'lib/cucumber/formatter/console_counts.rb' - - 'lib/cucumber/glue/invoke_in_world.rb' - - 'lib/cucumber/runtime.rb' - -# Offense count: 10 -# Cop supports --auto-correct. -Style/RedundantFreeze: - Exclude: - - 'lib/cucumber/cli/options.rb' - - 'lib/cucumber/formatter/unicode.rb' - - 'spec/cucumber/step_match_spec.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods. +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. # AllowedMethods: present?, blank?, presence, try, try! Style/SafeNavigation: Exclude: - - 'lib/cucumber/formatter/ansicolor.rb' - 'lib/cucumber/gherkin/formatter/ansi_escapes.rb' diff --git a/CHANGELOG.md b/CHANGELOG.md index 553d24b4a1..28b33065ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CONTRIBUTING.md) for more info on how to contribute to Cucumber. ## [Unreleased] +### Changed +- Began to tidy up (Cleared some AutoFix cops), and organise rubocop tech-debt in repo (This introduced new rubocop sub-gems) ([#1716](https://github.com/cucumber/cucumber-ruby/pull/1716) [luke-hill](https://github.com/luke-hill)) ## [9.0.1] - 2023-09-01 ### Changed diff --git a/Gemfile b/Gemfile index 54e9cdd8bc..ae3253d75b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source 'https://rubygems.org' gemspec diff --git a/Rakefile b/Rakefile index a27a7cd3d1..6c41a6c506 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rubygems' require 'bundler' diff --git a/cucumber.gemspec b/cucumber.gemspec index 6d399eefac..d82bf0c1ae 100644 --- a/cucumber.gemspec +++ b/cucumber.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Gem::Specification.new do |s| s.name = 'cucumber' s.version = File.read(File.expand_path('VERSION', __dir__)).strip @@ -37,7 +39,10 @@ Gem::Specification.new do |s| s.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6' s.add_development_dependency 'rspec', '~> 3.12', '>= 3.12.0' s.add_development_dependency 'rubocop', '1.43.0' + s.add_development_dependency 'rubocop-capybara', '2.18.0' s.add_development_dependency 'rubocop-packaging', '~> 0.5.2' + s.add_development_dependency 'rubocop-rake', '0.6' + s.add_development_dependency 'rubocop-rspec', '2.0.0' s.add_development_dependency 'simplecov', '~> 0.22', '>= 0.22.0' s.add_development_dependency 'syntax', '~> 1.2', '>= 1.2.2' s.add_development_dependency 'test-unit', '~> 3.6', '>= 3.6.1' diff --git a/examples/i18n/Rakefile b/examples/i18n/Rakefile index 9b483a8b22..cc565f9387 100644 --- a/examples/i18n/Rakefile +++ b/examples/i18n/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + desc 'Run features for all languages' task :cucumber do dir = File.dirname(__FILE__) diff --git a/examples/i18n/ar/Rakefile b/examples/i18n/ar/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/ar/Rakefile +++ b/examples/i18n/ar/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/ar/features/step_definitions/calculator_steps.rb b/examples/i18n/ar/features/step_definitions/calculator_steps.rb index 48a7903018..dbf50856b8 100644 --- a/examples/i18n/ar/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/ar/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'calculator' diff --git a/examples/i18n/ar/lib/calculator.rb b/examples/i18n/ar/lib/calculator.rb index ed8a5e4491..7065cb25a4 100644 --- a/examples/i18n/ar/lib/calculator.rb +++ b/examples/i18n/ar/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/bg/Rakefile b/examples/i18n/bg/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/bg/Rakefile +++ b/examples/i18n/bg/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/bg/features/step_definitions/calculator_steps.rb b/examples/i18n/bg/features/step_definitions/calculator_steps.rb index 361ee14d50..318942341f 100644 --- a/examples/i18n/bg/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/bg/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Дадено('е че съм въвел {int}') do |int| calc.push int end diff --git a/examples/i18n/bg/features/support/env.rb b/examples/i18n/bg/features/support/env.rb index 0f358a1e66..468f42dfe5 100644 --- a/examples/i18n/bg/features/support/env.rb +++ b/examples/i18n/bg/features/support/env.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/bg/features/support/world.rb b/examples/i18n/bg/features/support/world.rb index f730a0a7ae..be2582ee96 100644 --- a/examples/i18n/bg/features/support/world.rb +++ b/examples/i18n/bg/features/support/world.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module LazyCalc def calc @calc ||= Calculator.new diff --git a/examples/i18n/bg/lib/calculator.rb b/examples/i18n/bg/lib/calculator.rb index bdec9113e7..add97dc6a7 100644 --- a/examples/i18n/bg/lib/calculator.rb +++ b/examples/i18n/bg/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def initialize @stack = [] diff --git a/examples/i18n/ca/Rakefile b/examples/i18n/ca/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/ca/Rakefile +++ b/examples/i18n/ca/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/ca/features/step_definitions/calculator_steps.rb b/examples/i18n/ca/features/step_definitions/calculator_steps.rb index cdf39a4de9..fae6b3ac93 100644 --- a/examples/i18n/ca/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/ca/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'calculadora' diff --git a/examples/i18n/ca/lib/calculadora.rb b/examples/i18n/ca/lib/calculadora.rb index 890058d1a6..be8aff2dc7 100644 --- a/examples/i18n/ca/lib/calculadora.rb +++ b/examples/i18n/ca/lib/calculadora.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculadora def push(n) @args ||= [] diff --git a/examples/i18n/cs/Rakefile b/examples/i18n/cs/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/cs/Rakefile +++ b/examples/i18n/cs/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/cs/features/step_definitions/calculator_steps.rb b/examples/i18n/cs/features/step_definitions/calculator_steps.rb index aef3c1d83f..9d8d8b5540 100644 --- a/examples/i18n/cs/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/cs/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'calculator' diff --git a/examples/i18n/cs/lib/calculator.rb b/examples/i18n/cs/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/cs/lib/calculator.rb +++ b/examples/i18n/cs/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/da/Rakefile b/examples/i18n/da/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/da/Rakefile +++ b/examples/i18n/da/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/da/features/step_definitions/lommeregner_steps.rb b/examples/i18n/da/features/step_definitions/lommeregner_steps.rb index 2de00fb1c6..6487ecb024 100644 --- a/examples/i18n/da/features/step_definitions/lommeregner_steps.rb +++ b/examples/i18n/da/features/step_definitions/lommeregner_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/da/lib/lommeregner.rb b/examples/i18n/da/lib/lommeregner.rb index f635458817..a8ffb70eb4 100644 --- a/examples/i18n/da/lib/lommeregner.rb +++ b/examples/i18n/da/lib/lommeregner.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Lommeregner def push(n) @args ||= [] diff --git a/examples/i18n/de/Rakefile b/examples/i18n/de/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/de/Rakefile +++ b/examples/i18n/de/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/de/features/step_definitions/calculator_steps.rb b/examples/i18n/de/features/step_definitions/calculator_steps.rb index 35e4a3cbc0..4961e5bd75 100644 --- a/examples/i18n/de/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/de/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/de/lib/calculator.rb b/examples/i18n/de/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/de/lib/calculator.rb +++ b/examples/i18n/de/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/el/Rakefile b/examples/i18n/el/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/el/Rakefile +++ b/examples/i18n/el/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/el/features/step_definitions/calculator_steps.rb b/examples/i18n/el/features/step_definitions/calculator_steps.rb index 2ad00c9060..fb84874908 100644 --- a/examples/i18n/el/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/el/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'calculator' diff --git a/examples/i18n/el/lib/calculator.rb b/examples/i18n/el/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/el/lib/calculator.rb +++ b/examples/i18n/el/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/en-lol/Rakefile b/examples/i18n/en-lol/Rakefile index a7c622f6af..5e0187f468 100644 --- a/examples/i18n/en-lol/Rakefile +++ b/examples/i18n/en-lol/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb b/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb index ef83b0de44..fe180a109d 100644 --- a/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb +++ b/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ICANHAZ(/^IN TEH BEGINNIN (\d+) CUCUMBRZ$/) do |n| @basket = Basket.new(n.to_i) end diff --git a/examples/i18n/en-lol/features/support/env.rb b/examples/i18n/en-lol/features/support/env.rb index 928b3784a5..906a13dc57 100644 --- a/examples/i18n/en-lol/features/support/env.rb +++ b/examples/i18n/en-lol/features/support/env.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/en-lol/lib/basket.rb b/examples/i18n/en-lol/lib/basket.rb index 522fd41459..6598796007 100644 --- a/examples/i18n/en-lol/lib/basket.rb +++ b/examples/i18n/en-lol/lib/basket.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Basket attr_reader :cukes diff --git a/examples/i18n/en-lol/lib/belly.rb b/examples/i18n/en-lol/lib/belly.rb index 8529facca6..7c750cf679 100644 --- a/examples/i18n/en-lol/lib/belly.rb +++ b/examples/i18n/en-lol/lib/belly.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Belly attr_reader :cukes diff --git a/examples/i18n/en/Rakefile b/examples/i18n/en/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/en/Rakefile +++ b/examples/i18n/en/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/en/features/step_definitions/calculator_steps.rb b/examples/i18n/en/features/step_definitions/calculator_steps.rb index 8d9b400854..8e680cfe8e 100644 --- a/examples/i18n/en/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/en/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'calculator' diff --git a/examples/i18n/en/lib/calculator.rb b/examples/i18n/en/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/en/lib/calculator.rb +++ b/examples/i18n/en/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/eo/Rakefile b/examples/i18n/eo/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/eo/Rakefile +++ b/examples/i18n/eo/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/eo/features/step_definitions/calculator_steps.rb b/examples/i18n/eo/features/step_definitions/calculator_steps.rb index 14c27f85c8..b577f18e61 100644 --- a/examples/i18n/eo/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/eo/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'calculator' diff --git a/examples/i18n/eo/lib/calculator.rb b/examples/i18n/eo/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/eo/lib/calculator.rb +++ b/examples/i18n/eo/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/es/Rakefile b/examples/i18n/es/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/es/Rakefile +++ b/examples/i18n/es/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/es/features/step_definitions/calculador_steps.rb b/examples/i18n/es/features/step_definitions/calculador_steps.rb index 8190c3be8e..e186379aa9 100644 --- a/examples/i18n/es/features/step_definitions/calculador_steps.rb +++ b/examples/i18n/es/features/step_definitions/calculador_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'calculador' diff --git a/examples/i18n/es/lib/calculador.rb b/examples/i18n/es/lib/calculador.rb index ffcc1b8457..062e7e106d 100644 --- a/examples/i18n/es/lib/calculador.rb +++ b/examples/i18n/es/lib/calculador.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculador def push(n) @args ||= [] diff --git a/examples/i18n/et/Rakefile b/examples/i18n/et/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/et/Rakefile +++ b/examples/i18n/et/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb b/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb index 7eefcd36de..66decf378d 100644 --- a/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +++ b/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'kalkulaator' diff --git a/examples/i18n/et/lib/kalkulaator.rb b/examples/i18n/et/lib/kalkulaator.rb index 4f49d478ec..f956600b48 100644 --- a/examples/i18n/et/lib/kalkulaator.rb +++ b/examples/i18n/et/lib/kalkulaator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Kalkulaator def push(n) @args ||= [] diff --git a/examples/i18n/fi/Rakefile b/examples/i18n/fi/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/fi/Rakefile +++ b/examples/i18n/fi/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/fi/features/step_definitions/laskin_steps.rb b/examples/i18n/fi/features/step_definitions/laskin_steps.rb index e1fe1bd738..f57e2d31c6 100644 --- a/examples/i18n/fi/features/step_definitions/laskin_steps.rb +++ b/examples/i18n/fi/features/step_definitions/laskin_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/fi/lib/laskin.rb b/examples/i18n/fi/lib/laskin.rb index 5afe7a1aa7..99f25b0dd0 100644 --- a/examples/i18n/fi/lib/laskin.rb +++ b/examples/i18n/fi/lib/laskin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Laskin def pinoa(n) @args ||= [] diff --git a/examples/i18n/fr/Rakefile b/examples/i18n/fr/Rakefile index 6e54facad7..24e40558fb 100644 --- a/examples/i18n/fr/Rakefile +++ b/examples/i18n/fr/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb b/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb index 25d1808f50..e6c7b25049 100644 --- a/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +++ b/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Soit(/^une calculatrice$/) do @calc = Calculatrice.new end diff --git a/examples/i18n/fr/features/support/env.rb b/examples/i18n/fr/features/support/env.rb index e7966fc655..f9f8de239d 100644 --- a/examples/i18n/fr/features/support/env.rb +++ b/examples/i18n/fr/features/support/env.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/fr/lib/calculatrice.rb b/examples/i18n/fr/lib/calculatrice.rb index 7e3dc7b97e..55f4b1f738 100644 --- a/examples/i18n/fr/lib/calculatrice.rb +++ b/examples/i18n/fr/lib/calculatrice.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculatrice def push(n) @args ||= [] diff --git a/examples/i18n/he/Rakefile b/examples/i18n/he/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/he/Rakefile +++ b/examples/i18n/he/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/he/features/step_definitions/calculator_steps.rb b/examples/i18n/he/features/step_definitions/calculator_steps.rb index 3a4fcc98a4..e9844233d6 100644 --- a/examples/i18n/he/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/he/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/he/lib/calculator.rb b/examples/i18n/he/lib/calculator.rb index 1a94d6aad9..54f6406e95 100644 --- a/examples/i18n/he/lib/calculator.rb +++ b/examples/i18n/he/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/hi/Rakefile b/examples/i18n/hi/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/hi/Rakefile +++ b/examples/i18n/hi/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/hi/features/step_definitions/calculator_steps.rb b/examples/i18n/hi/features/step_definitions/calculator_steps.rb index 8ccff78948..fcf9d66986 100644 --- a/examples/i18n/hi/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/hi/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'calculator' diff --git a/examples/i18n/hi/lib/calculator.rb b/examples/i18n/hi/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/hi/lib/calculator.rb +++ b/examples/i18n/hi/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/ht/Rakefile b/examples/i18n/ht/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/ht/Rakefile +++ b/examples/i18n/ht/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/ht/features/step_definitions/kalkilatris_steps.rb b/examples/i18n/ht/features/step_definitions/kalkilatris_steps.rb index 466f5ae043..9ebf529c43 100644 --- a/examples/i18n/ht/features/step_definitions/kalkilatris_steps.rb +++ b/examples/i18n/ht/features/step_definitions/kalkilatris_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'kalkilatris' diff --git a/examples/i18n/ht/lib/kalkilatris.rb b/examples/i18n/ht/lib/kalkilatris.rb index a4434cfcfc..efea815083 100644 --- a/examples/i18n/ht/lib/kalkilatris.rb +++ b/examples/i18n/ht/lib/kalkilatris.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Kalkilatris def push(n) @args ||= [] diff --git a/examples/i18n/hu/Rakefile b/examples/i18n/hu/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/hu/Rakefile +++ b/examples/i18n/hu/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/hu/features/step_definitions/calculator_steps.rb b/examples/i18n/hu/features/step_definitions/calculator_steps.rb index 85460f08a0..6e7b925c92 100644 --- a/examples/i18n/hu/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/hu/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/hu/lib/calculator.rb b/examples/i18n/hu/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/hu/lib/calculator.rb +++ b/examples/i18n/hu/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/id/Rakefile b/examples/i18n/id/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/id/Rakefile +++ b/examples/i18n/id/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/id/features/step_definitions/calculator_steps.rb b/examples/i18n/id/features/step_definitions/calculator_steps.rb index 5323ac7642..d451635acd 100644 --- a/examples/i18n/id/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/id/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/id/lib/calculator.rb b/examples/i18n/id/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/id/lib/calculator.rb +++ b/examples/i18n/id/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/it/Rakefile b/examples/i18n/it/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/it/Rakefile +++ b/examples/i18n/it/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/it/features/step_definitions/calcolatrice_steps.rb b/examples/i18n/it/features/step_definitions/calcolatrice_steps.rb index f6c38889be..f8476f6b1a 100644 --- a/examples/i18n/it/features/step_definitions/calcolatrice_steps.rb +++ b/examples/i18n/it/features/step_definitions/calcolatrice_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/it/lib/calcolatrice.rb b/examples/i18n/it/lib/calcolatrice.rb index 85b29e0622..a4e0ad3b08 100644 --- a/examples/i18n/it/lib/calcolatrice.rb +++ b/examples/i18n/it/lib/calcolatrice.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calcolatrice def push(n) @args ||= [] diff --git a/examples/i18n/ja/Rakefile b/examples/i18n/ja/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/ja/Rakefile +++ b/examples/i18n/ja/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/ja/features/step_definitions/calculator_steps.rb b/examples/i18n/ja/features/step_definitions/calculator_steps.rb index e80ab20de5..329c2c429f 100644 --- a/examples/i18n/ja/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/ja/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Before do @calc = Calculator.new end diff --git a/examples/i18n/ja/features/support/env.rb b/examples/i18n/ja/features/support/env.rb index 0f358a1e66..468f42dfe5 100644 --- a/examples/i18n/ja/features/support/env.rb +++ b/examples/i18n/ja/features/support/env.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/ja/lib/calculator.rb b/examples/i18n/ja/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/ja/lib/calculator.rb +++ b/examples/i18n/ja/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/ko/Rakefile b/examples/i18n/ko/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/ko/Rakefile +++ b/examples/i18n/ko/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/ko/features/step_definitions/calculator_steps.rb b/examples/i18n/ko/features/step_definitions/calculator_steps.rb index e3624f9826..803f06771c 100644 --- a/examples/i18n/ko/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/ko/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/ko/lib/calculator.rb b/examples/i18n/ko/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/ko/lib/calculator.rb +++ b/examples/i18n/ko/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/lt/Rakefile b/examples/i18n/lt/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/lt/Rakefile +++ b/examples/i18n/lt/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/lt/features/step_definitions/calculator_steps.rb b/examples/i18n/lt/features/step_definitions/calculator_steps.rb index 90ef2ec412..b3364ac211 100644 --- a/examples/i18n/lt/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/lt/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/lt/lib/calculator.rb b/examples/i18n/lt/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/lt/lib/calculator.rb +++ b/examples/i18n/lt/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/lv/Rakefile b/examples/i18n/lv/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/lv/Rakefile +++ b/examples/i18n/lv/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/lv/features/step_definitions/calculator_steps.rb b/examples/i18n/lv/features/step_definitions/calculator_steps.rb index c939fed10a..aee0d6a359 100644 --- a/examples/i18n/lv/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/lv/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/lv/lib/calculator.rb b/examples/i18n/lv/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/lv/lib/calculator.rb +++ b/examples/i18n/lv/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/no/Rakefile b/examples/i18n/no/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/no/Rakefile +++ b/examples/i18n/no/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/no/features/step_definitions/kalkulator_steps.rb b/examples/i18n/no/features/step_definitions/kalkulator_steps.rb index 58f6a992e3..01af528cde 100644 --- a/examples/i18n/no/features/step_definitions/kalkulator_steps.rb +++ b/examples/i18n/no/features/step_definitions/kalkulator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Before do @calc = Kalkulator.new end diff --git a/examples/i18n/no/features/support/env.rb b/examples/i18n/no/features/support/env.rb index 2587907241..060c75cc87 100644 --- a/examples/i18n/no/features/support/env.rb +++ b/examples/i18n/no/features/support/env.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/no/lib/kalkulator.rb b/examples/i18n/no/lib/kalkulator.rb index d84b7d3bec..298fe9cd50 100644 --- a/examples/i18n/no/lib/kalkulator.rb +++ b/examples/i18n/no/lib/kalkulator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Kalkulator def push(n) @args ||= [] diff --git a/examples/i18n/pl/Rakefile b/examples/i18n/pl/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/pl/Rakefile +++ b/examples/i18n/pl/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/pl/features/step_definitions/calculator_steps.rb b/examples/i18n/pl/features/step_definitions/calculator_steps.rb index 5d06c4c36b..ec12b6e8fd 100644 --- a/examples/i18n/pl/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/pl/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/pl/features/support/env.rb b/examples/i18n/pl/features/support/env.rb index 0f358a1e66..468f42dfe5 100644 --- a/examples/i18n/pl/features/support/env.rb +++ b/examples/i18n/pl/features/support/env.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/pl/lib/calculator.rb b/examples/i18n/pl/lib/calculator.rb index 45e3254f4b..2897582aaf 100644 --- a/examples/i18n/pl/lib/calculator.rb +++ b/examples/i18n/pl/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/pt/Rakefile b/examples/i18n/pt/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/pt/Rakefile +++ b/examples/i18n/pt/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/pt/features/step_definitions/calculadora_steps.rb b/examples/i18n/pt/features/step_definitions/calculadora_steps.rb index d083356c4b..2e678db59b 100644 --- a/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +++ b/examples/i18n/pt/features/step_definitions/calculadora_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Before do @calc = Calculadora.new end diff --git a/examples/i18n/pt/features/support/env.rb b/examples/i18n/pt/features/support/env.rb index da56cfdc96..b384626be1 100644 --- a/examples/i18n/pt/features/support/env.rb +++ b/examples/i18n/pt/features/support/env.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/pt/lib/calculadora.rb b/examples/i18n/pt/lib/calculadora.rb index 22f6960fb0..30fcbf4d59 100644 --- a/examples/i18n/pt/lib/calculadora.rb +++ b/examples/i18n/pt/lib/calculadora.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculadora def push(n) @args ||= [] diff --git a/examples/i18n/ro/Rakefile b/examples/i18n/ro/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/ro/Rakefile +++ b/examples/i18n/ro/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/ro/features/step_definitions/calculator_steps.rb b/examples/i18n/ro/features/step_definitions/calculator_steps.rb index 0045d45935..a3399c9679 100644 --- a/examples/i18n/ro/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/ro/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/ro/lib/calculator.rb b/examples/i18n/ro/lib/calculator.rb index 306a9f2bc9..086ad16c51 100644 --- a/examples/i18n/ro/lib/calculator.rb +++ b/examples/i18n/ro/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/ru/Rakefile b/examples/i18n/ru/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/ru/Rakefile +++ b/examples/i18n/ru/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/ru/features/step_definitions/calculator_steps.rb b/examples/i18n/ru/features/step_definitions/calculator_steps.rb index 8c688d0c41..a0d59638c0 100644 --- a/examples/i18n/ru/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/ru/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Допустим('я ввожу число {int}') do |число| calc.push число end diff --git a/examples/i18n/ru/features/support/env.rb b/examples/i18n/ru/features/support/env.rb index 0f358a1e66..468f42dfe5 100644 --- a/examples/i18n/ru/features/support/env.rb +++ b/examples/i18n/ru/features/support/env.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/ru/features/support/world.rb b/examples/i18n/ru/features/support/world.rb index f730a0a7ae..be2582ee96 100644 --- a/examples/i18n/ru/features/support/world.rb +++ b/examples/i18n/ru/features/support/world.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module LazyCalc def calc @calc ||= Calculator.new diff --git a/examples/i18n/ru/lib/calculator.rb b/examples/i18n/ru/lib/calculator.rb index bdec9113e7..add97dc6a7 100644 --- a/examples/i18n/ru/lib/calculator.rb +++ b/examples/i18n/ru/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def initialize @stack = [] diff --git a/examples/i18n/sk/Rakefile b/examples/i18n/sk/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/sk/Rakefile +++ b/examples/i18n/sk/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/sk/features/step_definitions/calculator_steps.rb b/examples/i18n/sk/features/step_definitions/calculator_steps.rb index a6acbfb18b..40ebe3ffd1 100644 --- a/examples/i18n/sk/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/sk/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/sk/lib/calculator.rb b/examples/i18n/sk/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/sk/lib/calculator.rb +++ b/examples/i18n/sk/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/sr-Cyrl/Rakefile b/examples/i18n/sr-Cyrl/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/sr-Cyrl/Rakefile +++ b/examples/i18n/sr-Cyrl/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/sr-Cyrl/features/step_definitions/calculator_steps.rb b/examples/i18n/sr-Cyrl/features/step_definitions/calculator_steps.rb index 9ae868bc04..47a103d3a5 100644 --- a/examples/i18n/sr-Cyrl/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/sr-Cyrl/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Before do @calc = Calculator.new end diff --git a/examples/i18n/sr-Cyrl/features/support/env.rb b/examples/i18n/sr-Cyrl/features/support/env.rb index 7dd11e4dd7..f6af99ef92 100644 --- a/examples/i18n/sr-Cyrl/features/support/env.rb +++ b/examples/i18n/sr-Cyrl/features/support/env.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'calculator' diff --git a/examples/i18n/sr-Cyrl/lib/calculator.rb b/examples/i18n/sr-Cyrl/lib/calculator.rb index 306a9f2bc9..086ad16c51 100644 --- a/examples/i18n/sr-Cyrl/lib/calculator.rb +++ b/examples/i18n/sr-Cyrl/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/sr-Latn/Rakefile b/examples/i18n/sr-Latn/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/sr-Latn/Rakefile +++ b/examples/i18n/sr-Latn/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/sr-Latn/features/step_definitions/calculator_steps.rb b/examples/i18n/sr-Latn/features/step_definitions/calculator_steps.rb index a5830fec57..80e50b6066 100644 --- a/examples/i18n/sr-Latn/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/sr-Latn/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'calculator' diff --git a/examples/i18n/sr-Latn/lib/calculator.rb b/examples/i18n/sr-Latn/lib/calculator.rb index 306a9f2bc9..086ad16c51 100644 --- a/examples/i18n/sr-Latn/lib/calculator.rb +++ b/examples/i18n/sr-Latn/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/sv/Rakefile b/examples/i18n/sv/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/sv/Rakefile +++ b/examples/i18n/sv/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/sv/features/step_definitions/kalkulator_steps.rb b/examples/i18n/sv/features/step_definitions/kalkulator_steps.rb index 81f8332faa..457d2faf26 100644 --- a/examples/i18n/sv/features/step_definitions/kalkulator_steps.rb +++ b/examples/i18n/sv/features/step_definitions/kalkulator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/sv/lib/kalkulator.rb b/examples/i18n/sv/lib/kalkulator.rb index d84b7d3bec..298fe9cd50 100644 --- a/examples/i18n/sv/lib/kalkulator.rb +++ b/examples/i18n/sv/lib/kalkulator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Kalkulator def push(n) @args ||= [] diff --git a/examples/i18n/tr/Rakefile b/examples/i18n/tr/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/tr/Rakefile +++ b/examples/i18n/tr/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/tr/features/step_definitions/hesap_makinesi_adimlari.rb b/examples/i18n/tr/features/step_definitions/hesap_makinesi_adimlari.rb index a964e18500..d189ea6047 100644 --- a/examples/i18n/tr/features/step_definitions/hesap_makinesi_adimlari.rb +++ b/examples/i18n/tr/features/step_definitions/hesap_makinesi_adimlari.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/tr/lib/hesap_makinesi.rb b/examples/i18n/tr/lib/hesap_makinesi.rb index 78990156dd..73359f8c23 100644 --- a/examples/i18n/tr/lib/hesap_makinesi.rb +++ b/examples/i18n/tr/lib/hesap_makinesi.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class HesapMakinesi def push(n) @args ||= [] diff --git a/examples/i18n/uk/Rakefile b/examples/i18n/uk/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/uk/Rakefile +++ b/examples/i18n/uk/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/uk/features/step_definitions/calculator_steps.rb b/examples/i18n/uk/features/step_definitions/calculator_steps.rb index 1dfa285523..907fc8323e 100644 --- a/examples/i18n/uk/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/uk/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Припустимо('потім/я ввожу число {int}') do |число| calc.push число end diff --git a/examples/i18n/uk/features/support/env.rb b/examples/i18n/uk/features/support/env.rb index 7dd11e4dd7..f6af99ef92 100644 --- a/examples/i18n/uk/features/support/env.rb +++ b/examples/i18n/uk/features/support/env.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'calculator' diff --git a/examples/i18n/uk/features/support/world.rb b/examples/i18n/uk/features/support/world.rb index f730a0a7ae..be2582ee96 100644 --- a/examples/i18n/uk/features/support/world.rb +++ b/examples/i18n/uk/features/support/world.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module LazyCalc def calc @calc ||= Calculator.new diff --git a/examples/i18n/uk/lib/calculator.rb b/examples/i18n/uk/lib/calculator.rb index bdec9113e7..add97dc6a7 100644 --- a/examples/i18n/uk/lib/calculator.rb +++ b/examples/i18n/uk/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def initialize @stack = [] diff --git a/examples/i18n/uz/Rakefile b/examples/i18n/uz/Rakefile index 47e3afe93d..b48897224b 100644 --- a/examples/i18n/uz/Rakefile +++ b/examples/i18n/uz/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/uz/features/step_definitions/calculator_steps.rb b/examples/i18n/uz/features/step_definitions/calculator_steps.rb index 0610401d5f..4ff8a36363 100644 --- a/examples/i18n/uz/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/uz/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Агар('{int} сонини киритсам') do |сон| calc.push сон end diff --git a/examples/i18n/uz/features/support/env.rb b/examples/i18n/uz/features/support/env.rb index 7dd11e4dd7..f6af99ef92 100644 --- a/examples/i18n/uz/features/support/env.rb +++ b/examples/i18n/uz/features/support/env.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'calculator' diff --git a/examples/i18n/uz/features/support/world.rb b/examples/i18n/uz/features/support/world.rb index f730a0a7ae..be2582ee96 100644 --- a/examples/i18n/uz/features/support/world.rb +++ b/examples/i18n/uz/features/support/world.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module LazyCalc def calc @calc ||= Calculator.new diff --git a/examples/i18n/uz/lib/calculator.rb b/examples/i18n/uz/lib/calculator.rb index bdec9113e7..add97dc6a7 100644 --- a/examples/i18n/uz/lib/calculator.rb +++ b/examples/i18n/uz/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def initialize @stack = [] diff --git a/examples/i18n/zh-CN/Rakefile b/examples/i18n/zh-CN/Rakefile index a7c622f6af..5e0187f468 100644 --- a/examples/i18n/zh-CN/Rakefile +++ b/examples/i18n/zh-CN/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/zh-CN/features/step_definitions/calculator_steps.rb b/examples/i18n/zh-CN/features/step_definitions/calculator_steps.rb index f7a43d5e14..07d785e5e2 100644 --- a/examples/i18n/zh-CN/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/zh-CN/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'calculator' diff --git a/examples/i18n/zh-CN/lib/calculator.rb b/examples/i18n/zh-CN/lib/calculator.rb index 306a9f2bc9..086ad16c51 100644 --- a/examples/i18n/zh-CN/lib/calculator.rb +++ b/examples/i18n/zh-CN/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/i18n/zh-TW/Rakefile b/examples/i18n/zh-TW/Rakefile index a7c622f6af..5e0187f468 100644 --- a/examples/i18n/zh-TW/Rakefile +++ b/examples/i18n/zh-TW/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../../lib") require 'cucumber/rake/task' diff --git a/examples/i18n/zh-TW/features/step_definitions/calculator_steps.rb b/examples/i18n/zh-TW/features/step_definitions/calculator_steps.rb index 2f94478743..f285c32d9a 100644 --- a/examples/i18n/zh-TW/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/zh-TW/features/step_definitions/calculator_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'rspec/expectations' rescue LoadError diff --git a/examples/i18n/zh-TW/lib/calculator.rb b/examples/i18n/zh-TW/lib/calculator.rb index 2328f60a0d..f87001528c 100644 --- a/examples/i18n/zh-TW/lib/calculator.rb +++ b/examples/i18n/zh-TW/lib/calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Calculator def push(n) @args ||= [] diff --git a/examples/rspec_doubles/Rakefile b/examples/rspec_doubles/Rakefile index 3e6d1999e7..ce4242f3c8 100644 --- a/examples/rspec_doubles/Rakefile +++ b/examples/rspec_doubles/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'cucumber/rake/task' diff --git a/examples/rspec_doubles/features/step_definitions/calvin_steps.rb b/examples/rspec_doubles/features/step_definitions/calvin_steps.rb index 7f7cba7b33..0a1bc9d706 100644 --- a/examples/rspec_doubles/features/step_definitions/calvin_steps.rb +++ b/examples/rspec_doubles/features/step_definitions/calvin_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CardboardBox def initialize(transmogrifier) @transmogrifier = transmogrifier diff --git a/examples/rspec_doubles/features/support/env.rb b/examples/rspec_doubles/features/support/env.rb index da799f46b6..747d058c29 100644 --- a/examples/rspec_doubles/features/support/env.rb +++ b/examples/rspec_doubles/features/support/env.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # If you want to use a different mock framework than # RSpec-Mocks - just set configure that accordingly # diff --git a/examples/sinatra/Rakefile b/examples/sinatra/Rakefile index 703361b376..a0c483a68c 100644 --- a/examples/sinatra/Rakefile +++ b/examples/sinatra/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'cucumber/rake/task' diff --git a/examples/sinatra/app.rb b/examples/sinatra/app.rb index 756973c7df..95a0b62f9e 100644 --- a/examples/sinatra/app.rb +++ b/examples/sinatra/app.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + begin require 'sinatra' rescue LoadError diff --git a/examples/sinatra/features/step_definitions/add_steps.rb b/examples/sinatra/features/step_definitions/add_steps.rb index ec642c3506..07aa08751e 100644 --- a/examples/sinatra/features/step_definitions/add_steps.rb +++ b/examples/sinatra/features/step_definitions/add_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Given(/^I visit the calculator page$/) do visit '/add' end diff --git a/examples/sinatra/features/support/env.rb b/examples/sinatra/features/support/env.rb index e52a7a5615..3562075832 100644 --- a/examples/sinatra/features/support/env.rb +++ b/examples/sinatra/features/support/env.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # See http://wiki.github.com/cucumber/cucumber/sinatra # for more details about Sinatra with Cucumber diff --git a/examples/tcl/Rakefile b/examples/tcl/Rakefile index 703361b376..a0c483a68c 100644 --- a/examples/tcl/Rakefile +++ b/examples/tcl/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'cucumber/rake/task' diff --git a/examples/tcl/features/step_definitions/fib_steps.rb b/examples/tcl/features/step_definitions/fib_steps.rb index 03e01e84e8..8ffe728a71 100644 --- a/examples/tcl/features/step_definitions/fib_steps.rb +++ b/examples/tcl/features/step_definitions/fib_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + When(/^I ask Tcl to calculate fibonacci for (\d+)$/) do |n| @fib_result = @fib.eval("fib #{n}").to_i end diff --git a/examples/tcl/features/support/env.rb b/examples/tcl/features/support/env.rb index a913eb0b18..a0dabb7ddc 100644 --- a/examples/tcl/features/support/env.rb +++ b/examples/tcl/features/support/env.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rubygems' require 'tcl' diff --git a/examples/test_unit/Rakefile b/examples/test_unit/Rakefile index 703361b376..a0c483a68c 100644 --- a/examples/test_unit/Rakefile +++ b/examples/test_unit/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") require 'cucumber/rake/task' diff --git a/examples/test_unit/features/step_definitions/test_unit_steps.rb b/examples/test_unit/features/step_definitions/test_unit_steps.rb index e5e0e817af..34af0a724b 100644 --- a/examples/test_unit/features/step_definitions/test_unit_steps.rb +++ b/examples/test_unit/features/step_definitions/test_unit_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test/unit/assertions' World(Test::Unit::Assertions) diff --git a/features/lib/profile_steps.rb b/features/lib/profile_steps.rb index aa4db09327..f589ce2aac 100644 --- a/features/lib/profile_steps.rb +++ b/features/lib/profile_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Given('the following profile(s) is/are defined:') do |profiles| write_file('cucumber.yml', profiles) end diff --git a/features/lib/step_definitions/command_line_steps.rb b/features/lib/step_definitions/command_line_steps.rb index bfd5b51842..8650a7d921 100644 --- a/features/lib/step_definitions/command_line_steps.rb +++ b/features/lib/step_definitions/command_line_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + When('I run `cucumber{}`') do |args| execute_cucumber(args) end diff --git a/features/lib/step_definitions/cucumber_cli_steps.rb b/features/lib/step_definitions/cucumber_cli_steps.rb index 7b248b019d..ac565e593f 100644 --- a/features/lib/step_definitions/cucumber_cli_steps.rb +++ b/features/lib/step_definitions/cucumber_cli_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Then('I should see the CLI help') do expect(command_line.stdout).to include('Usage:') end diff --git a/features/lib/step_definitions/cucumber_steps.rb b/features/lib/step_definitions/cucumber_steps.rb index 4f472b85a4..9776d5e071 100644 --- a/features/lib/step_definitions/cucumber_steps.rb +++ b/features/lib/step_definitions/cucumber_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'securerandom' require 'nokogiri' diff --git a/features/lib/step_definitions/filesystem_steps.rb b/features/lib/step_definitions/filesystem_steps.rb index 58494b2cd6..ce719214d9 100644 --- a/features/lib/step_definitions/filesystem_steps.rb +++ b/features/lib/step_definitions/filesystem_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Given('a directory named {string}') do |path| FileUtils.mkdir_p(path) end diff --git a/features/lib/step_definitions/html_steps.rb b/features/lib/step_definitions/html_steps.rb index e5d135c671..485738c5fd 100644 --- a/features/lib/step_definitions/html_steps.rb +++ b/features/lib/step_definitions/html_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Then('output should be html with title {string}') do |title| document = Nokogiri::HTML.parse(command_line.stdout) expect(document.xpath('//title').text).to eq(title) diff --git a/features/lib/step_definitions/json_steps.rb b/features/lib/step_definitions/json_steps.rb index 7f45d49c7b..10f36a2520 100644 --- a/features/lib/step_definitions/json_steps.rb +++ b/features/lib/step_definitions/json_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Then('it should fail with JSON:') do |json| expect(command_line).to have_failed actual = normalise_json(JSON.parse(command_line.stdout)) diff --git a/features/lib/step_definitions/junit_steps.rb b/features/lib/step_definitions/junit_steps.rb index ac7f3b0f0f..736ba415cb 100644 --- a/features/lib/step_definitions/junit_steps.rb +++ b/features/lib/step_definitions/junit_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Then('the junit output file {string} should contain:') do |actual_file, text| actual = IO.read("#{File.expand_path('.')}/#{actual_file}") actual = remove_self_ref(replace_junit_time(actual)) diff --git a/features/lib/step_definitions/message_steps.rb b/features/lib/step_definitions/message_steps.rb index 0d190bb3e7..13cf97bd39 100644 --- a/features/lib/step_definitions/message_steps.rb +++ b/features/lib/step_definitions/message_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Then('messages types should be:') do |expected_types| parsed_json = command_line.stdout.split("\n").map { |line| JSON.parse(line) } message_types = parsed_json.map(&:keys).flatten.compact diff --git a/features/lib/step_definitions/scenarios_and_steps.rb b/features/lib/step_definitions/scenarios_and_steps.rb index 3c89b8b19b..270898f30a 100644 --- a/features/lib/step_definitions/scenarios_and_steps.rb +++ b/features/lib/step_definitions/scenarios_and_steps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + def snake_case(name) name.downcase.gsub(/\W/, '_') end diff --git a/features/lib/support/command_line.rb b/features/lib/support/command_line.rb index 068b47d73a..ab12092cbb 100644 --- a/features/lib/support/command_line.rb +++ b/features/lib/support/command_line.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rspec/expectations' require 'rspec/mocks' require 'rake' diff --git a/features/lib/support/env.rb b/features/lib/support/env.rb index eb1b97965f..d94f1b93a0 100644 --- a/features/lib/support/env.rb +++ b/features/lib/support/env.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + require 'cucumber/formatter/ansicolor' -CUCUMBER_FEATURES_PATH = 'features/lib'.freeze +CUCUMBER_FEATURES_PATH = 'features/lib' Before do |scenario| @original_cwd = Dir.pwd diff --git a/features/lib/support/filesystem.rb b/features/lib/support/filesystem.rb index 96d30c92fc..fa99b5a83a 100644 --- a/features/lib/support/filesystem.rb +++ b/features/lib/support/filesystem.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + def write_file(path, content) FileUtils.mkdir_p(File.dirname(path)) File.open(path, 'w') { |file| file.write(content) } diff --git a/features/lib/support/json.rb b/features/lib/support/json.rb index 0f46af75cb..54338c78f7 100644 --- a/features/lib/support/json.rb +++ b/features/lib/support/json.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module JSONWorld def normalise_json(json) # make sure duration was captured (should be >= 0) diff --git a/features/lib/support/junit.rb b/features/lib/support/junit.rb index de9f8f822d..866f80a7f2 100644 --- a/features/lib/support/junit.rb +++ b/features/lib/support/junit.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module JUnitWorld def replace_junit_time(time) time.gsub(/\d+\.\d\d+/m, '0.05') diff --git a/features/lib/support/output.rb b/features/lib/support/output.rb index 8b4b9e1b83..ce4e3a2983 100644 --- a/features/lib/support/output.rb +++ b/features/lib/support/output.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rspec/expectations' def clean_output(output) diff --git a/features/lib/support/parameter_types.rb b/features/lib/support/parameter_types.rb index f6fe4ddd1e..9ca1b38928 100644 --- a/features/lib/support/parameter_types.rb +++ b/features/lib/support/parameter_types.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ParameterType( name: 'list', regexp: /.*/, diff --git a/features/lib/support/step_definitions.rb b/features/lib/support/step_definitions.rb index 38da91d544..35653335c3 100644 --- a/features/lib/support/step_definitions.rb +++ b/features/lib/support/step_definitions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module StepDefinitionsWorld def step_definition(expression, content, keyword: 'Given') if content.is_a?(String) diff --git a/lib/cucumber/cli/options.rb b/lib/cucumber/cli/options.rb index 5021b59154..0a59ea312b 100644 --- a/lib/cucumber/cli/options.rb +++ b/lib/cucumber/cli/options.rb @@ -50,13 +50,13 @@ class Options FORMAT_HELP = (BUILTIN_FORMATS.keys.sort.map do |key| " #{key}#{' ' * (max - key.length)} : #{BUILTIN_FORMATS[key][1]}" end) + FORMAT_HELP_MSG - PROFILE_SHORT_FLAG = '-p'.freeze - NO_PROFILE_SHORT_FLAG = '-P'.freeze - PROFILE_LONG_FLAG = '--profile'.freeze - NO_PROFILE_LONG_FLAG = '--no-profile'.freeze - FAIL_FAST_FLAG = '--fail-fast'.freeze - RETRY_FLAG = '--retry'.freeze - RETRY_TOTAL_FLAG = '--retry-total'.freeze + PROFILE_SHORT_FLAG = '-p' + NO_PROFILE_SHORT_FLAG = '-P' + PROFILE_LONG_FLAG = '--profile' + NO_PROFILE_LONG_FLAG = '--no-profile' + FAIL_FAST_FLAG = '--fail-fast' + RETRY_FLAG = '--retry' + RETRY_TOTAL_FLAG = '--retry-total' OPTIONS_WITH_ARGS = [ '-r', '--require', '--i18n-keywords', '-f', '--format', '-o', '--out', '-t', '--tags', '-n', '--name', '-e', '--exclude', diff --git a/lib/cucumber/deprecate.rb b/lib/cucumber/deprecate.rb index 4514190c88..1baec8f843 100644 --- a/lib/cucumber/deprecate.rb +++ b/lib/cucumber/deprecate.rb @@ -42,7 +42,7 @@ def self.call(message, method, remove_after_version) module ForDevelopers def self.call(_message, _method, remove_after_version) - raise "This method is due for removal after version #{remove_after_version}" if Cucumber::VERSION >= remove_after_version + raise "This method is due for removal after version #{remove_after_version}" if remove_after_version <= Cucumber::VERSION end end diff --git a/lib/cucumber/errors.rb b/lib/cucumber/errors.rb index 98ff565e36..9805539e84 100644 --- a/lib/cucumber/errors.rb +++ b/lib/cucumber/errors.rb @@ -35,7 +35,8 @@ class Pending < Core::Test::Result::Pending # Raised when a step matches 2 or more StepDefinitions class Ambiguous < StandardError def initialize(step_name, step_definitions, used_guess) - message = String.new # rubocop:disable Style/EmptyLiteral + # TODO: [LH] - Just use a heredoc here to fix this up + message = String.new message << "Ambiguous match of \"#{step_name}\":\n\n" message << step_definitions.map(&:backtrace_line).join("\n") message << "\n\n" diff --git a/lib/cucumber/events/envelope.rb b/lib/cucumber/events/envelope.rb index 83585e7ff5..ae61f2b135 100644 --- a/lib/cucumber/events/envelope.rb +++ b/lib/cucumber/events/envelope.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/core/events' module Cucumber diff --git a/lib/cucumber/events/gherkin_source_parsed.rb b/lib/cucumber/events/gherkin_source_parsed.rb index deba2ac1c8..c5d7d6691b 100644 --- a/lib/cucumber/events/gherkin_source_parsed.rb +++ b/lib/cucumber/events/gherkin_source_parsed.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/core/events' module Cucumber diff --git a/lib/cucumber/events/gherkin_source_read.rb b/lib/cucumber/events/gherkin_source_read.rb index 9d2659d228..5ff1ab282e 100644 --- a/lib/cucumber/events/gherkin_source_read.rb +++ b/lib/cucumber/events/gherkin_source_read.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/core/events' module Cucumber diff --git a/lib/cucumber/events/test_case_finished.rb b/lib/cucumber/events/test_case_finished.rb index f51f53ca5f..0083203f09 100644 --- a/lib/cucumber/events/test_case_finished.rb +++ b/lib/cucumber/events/test_case_finished.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/core/events' module Cucumber diff --git a/lib/cucumber/events/test_case_started.rb b/lib/cucumber/events/test_case_started.rb index a7950339c0..75e2472865 100644 --- a/lib/cucumber/events/test_case_started.rb +++ b/lib/cucumber/events/test_case_started.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/core/events' module Cucumber diff --git a/lib/cucumber/events/test_step_finished.rb b/lib/cucumber/events/test_step_finished.rb index 9155d88898..bf7319955c 100644 --- a/lib/cucumber/events/test_step_finished.rb +++ b/lib/cucumber/events/test_step_finished.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/core/events' module Cucumber diff --git a/lib/cucumber/events/test_step_started.rb b/lib/cucumber/events/test_step_started.rb index 2a3bdb5ed4..9758694a69 100644 --- a/lib/cucumber/events/test_step_started.rb +++ b/lib/cucumber/events/test_step_started.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/core/events' module Cucumber diff --git a/lib/cucumber/events/undefined_parameter_type.rb b/lib/cucumber/events/undefined_parameter_type.rb index 59ae1a61b1..bb52281a4e 100644 --- a/lib/cucumber/events/undefined_parameter_type.rb +++ b/lib/cucumber/events/undefined_parameter_type.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/core/events' module Cucumber diff --git a/lib/cucumber/formatter/console.rb b/lib/cucumber/formatter/console.rb index aa38979f49..10b607dce6 100644 --- a/lib/cucumber/formatter/console.rb +++ b/lib/cucumber/formatter/console.rb @@ -48,7 +48,7 @@ def format_step(keyword, step_match, status, source_indent) def format_string(o, status) fmt = format_for(status) o.to_s.split("\n").map do |line| - if Proc == fmt.class + if fmt.instance_of?(Proc) fmt.call(line) else fmt % line @@ -108,7 +108,7 @@ def exception_message_string(e, indent_amount) # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/10655 def linebreaks(msg, max) - return msg unless max && max > 0 + return msg unless max.positive? msg.gsub(/.{1,#{max}}(?:\s|\Z)/) do (Regexp.last_match(0) + 5.chr).gsub(/\n\005/, "\n").gsub(/\005/, "\n") diff --git a/lib/cucumber/formatter/console_counts.rb b/lib/cucumber/formatter/console_counts.rb index 7e54b9dda1..8a7b37dea4 100644 --- a/lib/cucumber/formatter/console_counts.rb +++ b/lib/cucumber/formatter/console_counts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/formatter/console' module Cucumber @@ -30,7 +32,7 @@ def step_count def status_counts(summary) counts = Core::Test::Result::TYPES.map { |status| [status, summary.total(status)] } - counts = counts.select { |_status, count| count > 0 } + counts = counts.select { |_status, count| count.positive? } counts = counts.map { |status, count| format_string("#{count} #{status}", status) } "(#{counts.join(', ')})" if counts.any? end diff --git a/lib/cucumber/formatter/console_issues.rb b/lib/cucumber/formatter/console_issues.rb index 99ca3f1b89..e3bc914a94 100644 --- a/lib/cucumber/formatter/console_issues.rb +++ b/lib/cucumber/formatter/console_issues.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/formatter/console' module Cucumber diff --git a/lib/cucumber/formatter/errors.rb b/lib/cucumber/formatter/errors.rb index 4ee51991ab..e97bfb33c9 100644 --- a/lib/cucumber/formatter/errors.rb +++ b/lib/cucumber/formatter/errors.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cucumber module Formatter class TestCaseUnknownError < StandardError; end diff --git a/lib/cucumber/formatter/html.rb b/lib/cucumber/formatter/html.rb index 1d87986c9d..23229ed9e4 100644 --- a/lib/cucumber/formatter/html.rb +++ b/lib/cucumber/formatter/html.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/formatter/io' require 'cucumber/html_formatter' require 'cucumber/formatter/message_builder' diff --git a/lib/cucumber/formatter/http_io.rb b/lib/cucumber/formatter/http_io.rb index 7f1aaf3880..04aa3c1a1c 100644 --- a/lib/cucumber/formatter/http_io.rb +++ b/lib/cucumber/formatter/http_io.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'net/http' require 'tempfile' require 'shellwords' diff --git a/lib/cucumber/formatter/message_builder.rb b/lib/cucumber/formatter/message_builder.rb index de60ee90c7..3e52d69252 100644 --- a/lib/cucumber/formatter/message_builder.rb +++ b/lib/cucumber/formatter/message_builder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'base64' require 'cucumber/formatter/backtrace_filter' require 'cucumber/formatter/query/hook_by_test_step' diff --git a/lib/cucumber/formatter/query/hook_by_test_step.rb b/lib/cucumber/formatter/query/hook_by_test_step.rb index e36c6ea4f6..dd1be34c2b 100644 --- a/lib/cucumber/formatter/query/hook_by_test_step.rb +++ b/lib/cucumber/formatter/query/hook_by_test_step.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/formatter/errors' module Cucumber diff --git a/lib/cucumber/formatter/query/pickle_by_test.rb b/lib/cucumber/formatter/query/pickle_by_test.rb index bac6fef31d..304fb49399 100644 --- a/lib/cucumber/formatter/query/pickle_by_test.rb +++ b/lib/cucumber/formatter/query/pickle_by_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/formatter/errors' module Cucumber diff --git a/lib/cucumber/formatter/query/pickle_step_by_test_step.rb b/lib/cucumber/formatter/query/pickle_step_by_test_step.rb index 3764f18968..9d4ecd4bb3 100644 --- a/lib/cucumber/formatter/query/pickle_step_by_test_step.rb +++ b/lib/cucumber/formatter/query/pickle_step_by_test_step.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/formatter/errors' module Cucumber diff --git a/lib/cucumber/formatter/query/step_definitions_by_test_step.rb b/lib/cucumber/formatter/query/step_definitions_by_test_step.rb index 7904ba72e7..833b786202 100644 --- a/lib/cucumber/formatter/query/step_definitions_by_test_step.rb +++ b/lib/cucumber/formatter/query/step_definitions_by_test_step.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/formatter/errors' module Cucumber diff --git a/lib/cucumber/formatter/query/test_case_started_by_test_case.rb b/lib/cucumber/formatter/query/test_case_started_by_test_case.rb index 9604cac5e8..1df71b71a2 100644 --- a/lib/cucumber/formatter/query/test_case_started_by_test_case.rb +++ b/lib/cucumber/formatter/query/test_case_started_by_test_case.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/formatter/errors' module Cucumber diff --git a/lib/cucumber/formatter/unicode.rb b/lib/cucumber/formatter/unicode.rb index 7f2442b6a6..94e4c2bf92 100644 --- a/lib/cucumber/formatter/unicode.rb +++ b/lib/cucumber/formatter/unicode.rb @@ -10,13 +10,13 @@ Cucumber::CODEPAGE = ENV['CUCUMBER_OUTPUT_ENCODING'] elsif `cmd /c chcp` =~ /(\d+)/ if [65_000, 65_001].include? Regexp.last_match(1).to_i - Cucumber::CODEPAGE = 'UTF-8'.freeze + Cucumber::CODEPAGE = 'UTF-8' ENV['ANSICON_API'] = 'ruby' else - Cucumber::CODEPAGE = "cp#{Regexp.last_match(1).to_i}".freeze + Cucumber::CODEPAGE = "cp#{Regexp.last_match(1).to_i}" end else - Cucumber::CODEPAGE = 'cp1252'.freeze + Cucumber::CODEPAGE = 'cp1252' $stderr.puts("WARNING: Couldn't detect your output codepage. Assuming it is 1252. You may have to chcp 1252 or SET CUCUMBER_OUTPUT_ENCODING=cp1252.") end diff --git a/lib/cucumber/formatter/url_reporter.rb b/lib/cucumber/formatter/url_reporter.rb index 899dd028dc..3d4aaf7320 100644 --- a/lib/cucumber/formatter/url_reporter.rb +++ b/lib/cucumber/formatter/url_reporter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cucumber module Formatter class URLReporter diff --git a/lib/cucumber/glue/invoke_in_world.rb b/lib/cucumber/glue/invoke_in_world.rb index 6982d9edf2..ba3c07af46 100644 --- a/lib/cucumber/glue/invoke_in_world.rb +++ b/lib/cucumber/glue/invoke_in_world.rb @@ -28,7 +28,7 @@ def self.cucumber_instance_exec_in(world, check_arity, pseudo_method, *args, &bl if check_arity && !cucumber_compatible_arity?(args, block) world.instance_exec do ari = block.arity - ari = ari < 0 ? "#{ari.abs - 1}+" : ari + ari = ari.negative? ? "#{ari.abs - 1}+" : ari s1 = ari == 1 ? '' : 's' s2 = args.length == 1 ? '' : 's' raise ArityMismatchError, "Your block takes #{ari} argument#{s1}, but the Regexp matched #{args.length} argument#{s2}." diff --git a/lib/cucumber/glue/proto_world.rb b/lib/cucumber/glue/proto_world.rb index 40bb779832..fdc57f8612 100644 --- a/lib/cucumber/glue/proto_world.rb +++ b/lib/cucumber/glue/proto_world.rb @@ -26,7 +26,7 @@ module ProtoWorld # @example Passing a multiline string # step "the email should contain:", "Dear sir,\nYou've won a prize!\n" # @param [String] name The name of the step - # @param [String,Cucumber::Test::DocString,Cucumber::Ast::Table] multiline_argument + # @param [String, Cucumber::Test::DocString, Cucumber::Ast::Table] multiline_argument def step(name, raw_multiline_arg = nil) super end @@ -128,7 +128,7 @@ def to_s # Dynamially generate the API module, closuring the dependencies def self.for(runtime, language) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize - Module.new do # rubocop:disable Metrics/BlockLength + Module.new do def self.extended(object) # wrap the dynamically generated module so that we can document the methods # for yardoc, which doesn't like define_method. diff --git a/lib/cucumber/glue/registry_and_more.rb b/lib/cucumber/glue/registry_and_more.rb index 73c2cf8fd1..653bebeebb 100644 --- a/lib/cucumber/glue/registry_and_more.rb +++ b/lib/cucumber/glue/registry_and_more.rb @@ -29,7 +29,8 @@ def initialize # Raised if there are 2 or more World blocks. class MultipleWorld < StandardError def initialize(first_proc, second_proc) - message = String.new # rubocop:disable Style/EmptyLiteral + # TODO: [LH] - Just use a heredoc here to fix this up + message = String.new message << "You can only pass a proc to #World once, but it's happening\n" message << "in 2 places:\n\n" message << Glue.backtrace_line(first_proc, 'World') << "\n" diff --git a/lib/cucumber/glue/snippet.rb b/lib/cucumber/glue/snippet.rb index 604e4e48f9..bb8250e3d2 100644 --- a/lib/cucumber/glue/snippet.rb +++ b/lib/cucumber/glue/snippet.rb @@ -61,7 +61,8 @@ def replace_and_count_capturing_groups(pattern) end def do_block - do_block = String.new # rubocop:disable Style/EmptyLiteral + # TODO: [LH] - Just use a heredoc here to fix this up + do_block = String.new do_block << "do#{parameters}\n" multiline_argument.append_comment_to(do_block) do_block << " pending # Write code here that turns the phrase above into concrete actions\n" @@ -95,7 +96,8 @@ def to_s "#{prefix}#{code_keyword}('#{expr.source}') do#{parameters(expr)}" end.join("\n") - body = String.new # rubocop:disable Style/EmptyLiteral + # TODO: [LH] - Just use a heredoc here to fix this up + body = String.new multiline_argument.append_comment_to(body) body << " pending # Write code here that turns the phrase above into concrete actions\n" body << 'end' diff --git a/lib/cucumber/glue/world_factory.rb b/lib/cucumber/glue/world_factory.rb index d7bd388caa..f7894f819e 100644 --- a/lib/cucumber/glue/world_factory.rb +++ b/lib/cucumber/glue/world_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cucumber module Glue class WorldFactory diff --git a/lib/cucumber/multiline_argument/data_table.rb b/lib/cucumber/multiline_argument/data_table.rb index 939235d6af..ba54e566b6 100644 --- a/lib/cucumber/multiline_argument/data_table.rb +++ b/lib/cucumber/multiline_argument/data_table.rb @@ -506,7 +506,7 @@ def clear_cache! # :nodoc: end def ensure_table(table_or_array) # :nodoc: - return table_or_array if DataTable == table_or_array.class + return table_or_array if table_or_array.instance_of?(DataTable) DataTable.from(table_or_array) end @@ -591,7 +591,7 @@ def inspect! end def ==(other) - SurplusCell == other.class || value == other.value + other.class == SurplusCell || value == other.value end def eql?(other) diff --git a/lib/cucumber/multiline_argument/data_table/diff_matrices.rb b/lib/cucumber/multiline_argument/data_table/diff_matrices.rb index 14a65fb905..43a5ed6c38 100644 --- a/lib/cucumber/multiline_argument/data_table/diff_matrices.rb +++ b/lib/cucumber/multiline_argument/data_table/diff_matrices.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cucumber module MultilineArgument class DataTable diff --git a/lib/cucumber/runtime.rb b/lib/cucumber/runtime.rb index f090db83c5..777b4993fe 100644 --- a/lib/cucumber/runtime.rb +++ b/lib/cucumber/runtime.rb @@ -112,7 +112,7 @@ def doc_string(string_without_triple_quotes, content_type = '', _line_offset = 0 def failure? if @configuration.wip? - summary_report.test_cases.total_passed > 0 + summary_report.test_cases.total_passed.positive? else !summary_report.ok?(@configuration.strict) end diff --git a/lib/cucumber/runtime/meta_message_builder.rb b/lib/cucumber/runtime/meta_message_builder.rb index 0d0e6cef49..e1322b6b1a 100644 --- a/lib/cucumber/runtime/meta_message_builder.rb +++ b/lib/cucumber/runtime/meta_message_builder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/messages' require 'cucumber/ci_environment' diff --git a/lib/cucumber/step_match.rb b/lib/cucumber/step_match.rb index 223d0f9328..6737822402 100644 --- a/lib/cucumber/step_match.rb +++ b/lib/cucumber/step_match.rb @@ -78,7 +78,7 @@ def replace_arguments(string, step_arguments, format) replacement = if block_given? yield(group.value) - elsif Proc == format.class + elsif format.instance_of?(Proc) format.call(group.value) else format % group.value diff --git a/lib/cucumber/term/banner.rb b/lib/cucumber/term/banner.rb index a968ed0400..6139d972bd 100644 --- a/lib/cucumber/term/banner.rb +++ b/lib/cucumber/term/banner.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/term/ansicolor' module Cucumber diff --git a/scripts/invite-collaborator b/scripts/invite-collaborator index 06c6f926fb..7e6656cea5 100755 --- a/scripts/invite-collaborator +++ b/scripts/invite-collaborator @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require 'octokit' class Team diff --git a/scripts/update-changelog b/scripts/update-changelog index 8543563283..ce658d1376 100755 --- a/scripts/update-changelog +++ b/scripts/update-changelog @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require 'octokit' class PullRequest diff --git a/spec/cck/cck_spec.rb b/spec/cck/cck_spec.rb index e1c8f0c74d..f177af78a2 100644 --- a/spec/cck/cck_spec.rb +++ b/spec/cck/cck_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber-compatibility-kit' describe 'Cucumber Compatibility Kit', cck: true do diff --git a/spec/cucumber/formatter/backtrace_filter_spec.rb b/spec/cucumber/formatter/backtrace_filter_spec.rb index 43381756ec..dc5d8897c4 100644 --- a/spec/cucumber/formatter/backtrace_filter_spec.rb +++ b/spec/cucumber/formatter/backtrace_filter_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/formatter/backtrace_filter' module Cucumber diff --git a/spec/cucumber/formatter/console_counts_spec.rb b/spec/cucumber/formatter/console_counts_spec.rb index 7cdbd9ce36..2b3e5c5e8d 100644 --- a/spec/cucumber/formatter/console_counts_spec.rb +++ b/spec/cucumber/formatter/console_counts_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/configuration' require 'cucumber/formatter/console_counts' diff --git a/spec/cucumber/formatter/console_spec.rb b/spec/cucumber/formatter/console_spec.rb index 12b7140002..4f9a1b06c0 100644 --- a/spec/cucumber/formatter/console_spec.rb +++ b/spec/cucumber/formatter/console_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/configuration' require 'cucumber/formatter/console' diff --git a/spec/cucumber/formatter/url_reporter_spec.rb b/spec/cucumber/formatter/url_reporter_spec.rb index fd59becbbd..26775bf856 100644 --- a/spec/cucumber/formatter/url_reporter_spec.rb +++ b/spec/cucumber/formatter/url_reporter_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'stringio' require 'uri' require 'cucumber/formatter/url_reporter' diff --git a/spec/cucumber/runtime/after_hooks_spec.rb b/spec/cucumber/runtime/after_hooks_spec.rb index 09377e5ac1..4d2ac2f91f 100644 --- a/spec/cucumber/runtime/after_hooks_spec.rb +++ b/spec/cucumber/runtime/after_hooks_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'cucumber/runtime/hooks_examples' diff --git a/spec/cucumber/runtime/before_hooks_spec.rb b/spec/cucumber/runtime/before_hooks_spec.rb index 52c4a5a60f..bc3b058a7b 100644 --- a/spec/cucumber/runtime/before_hooks_spec.rb +++ b/spec/cucumber/runtime/before_hooks_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'cucumber/runtime/hooks_examples' diff --git a/spec/cucumber/runtime/hooks_examples.rb b/spec/cucumber/runtime/hooks_examples.rb index d99dfd882a..c70a80893c 100644 --- a/spec/cucumber/runtime/hooks_examples.rb +++ b/spec/cucumber/runtime/hooks_examples.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'cucumber/messages/id_generator' diff --git a/spec/cucumber/runtime/meta_message_builder_spec.rb b/spec/cucumber/runtime/meta_message_builder_spec.rb index 106b58b2cb..f54ae28a8e 100644 --- a/spec/cucumber/runtime/meta_message_builder_spec.rb +++ b/spec/cucumber/runtime/meta_message_builder_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'cucumber/runtime/meta_message_builder' diff --git a/spec/cucumber/step_match_search_spec.rb b/spec/cucumber/step_match_search_spec.rb index e045734e55..1f9530c044 100644 --- a/spec/cucumber/step_match_search_spec.rb +++ b/spec/cucumber/step_match_search_spec.rb @@ -88,8 +88,8 @@ module Cucumber it 'picks most specific step definition when an unequal number of capture groups' do _general = dsl.Given(/Three (.*) mice ran (.*)/) { |disability| } - _specific = dsl.Given(/Three blind mice ran far/) { ; } - more_specific = dsl.Given(/^Three blind mice ran far$/) { ; } + _specific = dsl.Given(/Three blind mice ran far/) {} + more_specific = dsl.Given(/^Three blind mice ran far$/) {} expect(search.call('Three blind mice ran far').first.step_definition).to eq more_specific end diff --git a/spec/cucumber/term/banner_spec.rb b/spec/cucumber/term/banner_spec.rb index 9163463e30..252a629c1d 100644 --- a/spec/cucumber/term/banner_spec.rb +++ b/spec/cucumber/term/banner_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cucumber/term/banner' describe Cucumber::Term::Banner do