mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Prefer respond_to? to defined? in MSpec
This commit is contained in:
parent
ee611341c9
commit
2321ade41d
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ class MatchYAMLMatcher
|
|||
def valid_yaml?(obj)
|
||||
require 'yaml'
|
||||
begin
|
||||
if defined?(YAML.unsafe_load)
|
||||
if YAML.respond_to?(:unsafe_load)
|
||||
YAML.unsafe_load(obj)
|
||||
else
|
||||
YAML.load(obj)
|
||||
|
|
Loading…
Reference in a new issue