Skip to content

Commit

Permalink
[Refactor] DRY up {PRE_RUBY_V19,RUBY_V19_AND_LATER}_EXCLUDED_METHODS
Browse files Browse the repository at this point in the history
  • Loading branch information
nitishr committed Dec 2, 2019
1 parent 8df3f92 commit f9a62e3
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions test/unit/mock_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,13 @@ def test_should_be_equal
MACOS_EXCLUDED_METHODS =
MACOS && MACOS_VERSION >= MACOS_MOJAVE_VERSION ? [:syscall] : []

RUBY_V19_AND_LATER_EXCLUDED_METHODS = [
:object_id,
:method_missing,
:singleton_method_undefined,
:initialize,
:String,
:Array,
:singleton_method_added,
*MACOS_EXCLUDED_METHODS
].freeze
RUBY_V19_AND_LATER_EXCLUDED_METHODS =
(PRE_RUBY_V19_EXCLUDED_METHODS.map(&:to_sym) + [
:object_id,
:String,
:singleton_method_added,
*MACOS_EXCLUDED_METHODS
]).freeze

OBJECT_METHODS = STANDARD_OBJECT_PUBLIC_INSTANCE_METHODS.reject do |m|
(m =~ /^__.*__$/) ||
Expand Down

0 comments on commit f9a62e3

Please sign in to comment.