Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit fdd801c

Browse files
committed
Fix offences
1 parent b69244f commit fdd801c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/rspec/support/encoded_string.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def to_s
4848
end
4949
alias :to_str :to_s
5050

51+
def self.pick_encoding(source_a, source_b)
52+
Encoding.compatible?(source_a, source_b) || Encoding.default_external
53+
end
54+
5155
private
5256

5357
# Encoding Exceptions:
@@ -98,7 +102,7 @@ def matching_encoding(string)
98102
# 'invalid: :replace' also replaces an invalid byte sequence
99103
#
100104
# For example:
101-
# "\x80".force_encoding("Emacs-Mule").encode(:invalid => :replace).bytes.to_a # =>
105+
# "\x80".force_encoding("Emacs-Mule").encode(:invalid => :replace).bytes.to_a # =>
102106
# => 63 # '?'
103107
#
104108
string.encode(@encoding, :invalid => :replace, :undef => :replace, :replace => REPLACE)
@@ -115,10 +119,6 @@ def remove_invalid_bytes(string)
115119
def detect_source_encoding(string)
116120
string.encoding
117121
end
118-
119-
def self.pick_encoding(source_a, source_b)
120-
Encoding.compatible?(source_a, source_b) || Encoding.default_external
121-
end
122122
end
123123
end
124124
end

lib/rspec/support/method_signature_verifier.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Support
88
# keyword args of a given method.
99
#
1010
# @private
11-
class MethodSignature # rubocop:disable ClassLength
11+
class MethodSignature
1212
attr_reader :min_non_kw_args, :max_non_kw_args, :optional_kw_args, :required_kw_args
1313

1414
def initialize(method)
@@ -219,7 +219,7 @@ def initialize(signature, args=[])
219219
@arbitrary_kw_args = @unlimited_args = false
220220
end
221221

222-
def with_expectation(expectation) # rubocop:disable MethodLength, Metrics/PerceivedComplexity
222+
def with_expectation(expectation)
223223
return self unless MethodSignatureExpectation === expectation
224224

225225
if expectation.empty?

0 commit comments

Comments
 (0)