Skip to content

Commit

Permalink
Prefer respond_to? to defined? in MSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Jun 2, 2021
1 parent 14bfab6 commit 0091e8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mspec/matchers/match_yaml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def clean_yaml(yaml)
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)
Expand Down

0 comments on commit 0091e8a

Please sign in to comment.