File tree Expand file tree Collapse file tree 6 files changed +10
-7
lines changed
Expand file tree Collapse file tree 6 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 44 - 2.5.5
55 - 2.6.2 # Uses unicode 12.0.0
66 - 2.6.3 # Uses unicode 12.1.0
7+ - 2.7.0
78 - ruby-head
89matrix :
910 allow_failures :
Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ module Regexp
55 # No core classes are extended in any way, other than the above two methods.
66 module Examples
77 def examples ( **config_options )
8- RegexpExamples ::Config . with_configuration ( config_options ) do
8+ RegexpExamples ::Config . with_configuration ( ** config_options ) do
99 examples_by_method ( :result )
1010 end
1111 end
1212
1313 def random_example ( **config_options )
14- RegexpExamples ::Config . with_configuration ( config_options ) do
14+ RegexpExamples ::Config . with_configuration ( ** config_options ) do
1515 examples_by_method ( :random_result ) . sample
1616 end
1717 end
Original file line number Diff line number Diff line change @@ -27,10 +27,10 @@ def with_configuration(**new_config)
2727 original_config = config . dup
2828
2929 begin
30- self . config = new_config
30+ update_config ( ** new_config )
3131 result = yield
3232 ensure
33- self . config = original_config
33+ update_config ( ** original_config )
3434 end
3535
3636 result
@@ -48,7 +48,7 @@ def with_configuration(**new_config)
4848
4949 private
5050
51- def config = ( **args )
51+ def update_config ( **args )
5252 Thread . current [ :regexp_examples_config ] . merge! ( args )
5353 end
5454
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ Gem::Specification.new do |s|
1717 s . add_development_dependency 'bundler' , '> 1.7'
1818 s . add_development_dependency 'rake' , '~> 12.0'
1919 s . add_development_dependency 'pry' , '~> 0.12.0'
20+ s . add_development_dependency 'warning' , '~> 0.10.0'
2021 s . license = 'MIT'
2122 s . required_ruby_version = '>= 2.4.0'
2223end
Original file line number Diff line number Diff line change 66require './lib/regexp-examples.rb'
77require 'helpers'
88require 'pry'
9+ require 'warning'
910
1011# Several of these tests (intentionally) use "weird" regex patterns,
1112# that spam annoying warnings when running.
1213# E.g. warning: invalid back reference: /\k/
1314# and warning: character class has ']' without escape: /[]]/
1415# This config disables those warnings.
15- $VERBOSE = nil
16+ Warning . ignore ( // , __dir__ )
1617
1718RSpec . configure do |config |
1819 config . include Helpers
Original file line number Diff line number Diff line change 6565
6666 # This setting enables warnings. It's recommended, but in some cases may
6767 # be too noisy due to issues in dependencies.
68- config . warnings = true
68+ config . warnings = false
6969
7070 # Many RSpec users commonly either run the entire suite or an individual
7171 # file, and it's useful to allow more verbose output when running an
You can’t perform that action at this time.
0 commit comments