Skip to content

Commit

Permalink
vte3-gi test: omit_if_not_respond can accept String and Symbol in sec…
Browse files Browse the repository at this point in the history
…ond argument explicitly
  • Loading branch information
cosmo0920 committed Oct 22, 2014
1 parent 54c52ea commit 67b0866
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions vte3-gi/test/vte3-test-utils.rb
Expand Up @@ -19,9 +19,15 @@

module VteTestUtils
private
def omit_if_not_respond(instance, method)
unless instance.respond_to?(method.to_sym)
omit("#{instance.class}##{method} is not respond.")
def omit_if_not_respond(instance, method_name_or_sym)
case method_name_or_sym.class
when String
method_sym = method_name_or_sym.to_sym
else
method_sym = method_name_or_sym
end
unless instance.respond_to?(method_sym)
omit("#{instance.class}##{method_sym} is not respond.")
end
end
end

0 comments on commit 67b0866

Please sign in to comment.