From 4e51bafa7a405421acb0145e5223f770b36505c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= Date: Thu, 30 Jul 2015 09:11:42 +0200 Subject: [PATCH] Does Hash#try_convert work in all supported Ruby versions? --- lib/cucumber/cli/configuration.rb | 2 +- lib/cucumber/cli/options.rb | 2 +- lib/cucumber/configuration.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cucumber/cli/configuration.rb b/lib/cucumber/cli/configuration.rb index 27b2c0d296..1a2111834c 100644 --- a/lib/cucumber/cli/configuration.rb +++ b/lib/cucumber/cli/configuration.rb @@ -110,7 +110,7 @@ def paths end def to_hash - Hash(@options).merge(out_stream: @out_stream, error_stream: @error_stream) + Hash.try_convert(@options).merge(out_stream: @out_stream, error_stream: @error_stream) end private diff --git a/lib/cucumber/cli/options.rb b/lib/cucumber/cli/options.rb index c2feee660a..3e0abef900 100644 --- a/lib/cucumber/cli/options.rb +++ b/lib/cucumber/cli/options.rb @@ -290,7 +290,7 @@ def check_formatter_stream_conflicts() end def to_hash - Hash(@options) + Hash.try_convert(@options) end protected diff --git a/lib/cucumber/configuration.rb b/lib/cucumber/configuration.rb index a8b15ef43d..89b64f7302 100644 --- a/lib/cucumber/configuration.rb +++ b/lib/cucumber/configuration.rb @@ -12,7 +12,7 @@ def self.default end def initialize(user_options = {}) - @options = default_options.merge(Hash(user_options)) + @options = default_options.merge(Hash.try_convert(user_options)) end # TODO: Actually Deprecate???