aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/regexp_ext_test.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 18:03:25 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 18:10:53 +0200
commita731125f12c5834de7eae3455fad63ea4d348034 (patch)
tree0ada76c652c1a2a1fd68cdbecf5adc2df6beeb51 /activesupport/test/core_ext/regexp_ext_test.rb
parentd66e7835bea9505f7003e5038aa19b6ea95ceea1 (diff)
downloadrails-a731125f12c5834de7eae3455fad63ea4d348034.tar.gz
rails-a731125f12c5834de7eae3455fad63ea4d348034.tar.bz2
rails-a731125f12c5834de7eae3455fad63ea4d348034.zip
applies new string literal convention in activesupport/test
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'activesupport/test/core_ext/regexp_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/regexp_ext_test.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/activesupport/test/core_ext/regexp_ext_test.rb b/activesupport/test/core_ext/regexp_ext_test.rb
index d91e363085..e569a9f234 100644
--- a/activesupport/test/core_ext/regexp_ext_test.rb
+++ b/activesupport/test/core_ext/regexp_ext_test.rb
@@ -1,5 +1,5 @@
-require 'abstract_unit'
-require 'active_support/core_ext/regexp'
+require "abstract_unit"
+require "active_support/core_ext/regexp"
class RegexpExtAccessTests < ActiveSupport::TestCase
def test_multiline
@@ -10,17 +10,17 @@ class RegexpExtAccessTests < ActiveSupport::TestCase
# Based on https://github.com/ruby/ruby/blob/trunk/test/ruby/test_regexp.rb.
def test_match_p
- /back(...)/ =~ 'backref'
+ /back(...)/ =~ "backref"
# must match here, but not in a separate method, e.g., assert_send,
# to check if $~ is affected or not.
assert_equal false, //.match?(nil)
assert_equal true, //.match?("")
assert_equal true, /.../.match?(:abc)
assert_raise(TypeError) { /.../.match?(Object.new) }
- assert_equal true, /b/.match?('abc')
- assert_equal true, /b/.match?('abc', 1)
- assert_equal true, /../.match?('abc', 1)
- assert_equal true, /../.match?('abc', -2)
+ assert_equal true, /b/.match?("abc")
+ assert_equal true, /b/.match?("abc", 1)
+ assert_equal true, /../.match?("abc", 1)
+ assert_equal true, /../.match?("abc", -2)
assert_equal false, /../.match?("abc", -4)
assert_equal false, /../.match?("abc", 4)
assert_equal true, /\z/.match?("")
@@ -28,7 +28,7 @@ class RegexpExtAccessTests < ActiveSupport::TestCase
assert_equal true, /R.../.match?("Ruby")
assert_equal false, /R.../.match?("Ruby", 1)
assert_equal false, /P.../.match?("Ruby")
- assert_equal 'backref', $&
- assert_equal 'ref', $1
+ assert_equal "backref", $&
+ assert_equal "ref", $1
end
end