We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5104768 commit 2b87b46Copy full SHA for 2b87b46
core/env/spec_helper.rb
@@ -1,6 +1,6 @@
1
require_relative '../../spec_helper'
2
3
-class BeLocaleEnvEncodingString
+locale_env_matcher = Class.new do
4
def initialize(name = 'locale')
5
encoding = Encoding.find(name)
6
@encodings = (encoding = Encoding::US_ASCII) ?
@@ -21,8 +21,6 @@ def negative_failure_message
21
end
22
23
24
-class String
25
- def be_locale_env(expected = 'locale')
26
- BeLocaleEnvEncodingString.new(expected)
27
- end
+String.__send__(:define_method, :be_locale_env) do |expected = 'locale'|
+ locale_env_matcher.new(expected)
28
0 commit comments