From 4dbf118a16c7d687894d441d2f2e6165cd0be384 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 22 Jun 2015 14:52:41 -0400 Subject: [PATCH] Fix Style/Not cop violations --- spec/support/select2_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/support/select2_helper.rb b/spec/support/select2_helper.rb index 691f84f39d4..04d25b5e9e9 100644 --- a/spec/support/select2_helper.rb +++ b/spec/support/select2_helper.rb @@ -12,9 +12,9 @@ module Select2Helper def select2(value, options={}) - raise "Must pass a hash containing 'from'" if not options.is_a?(Hash) or not options.has_key?(:from) + raise ArgumentError, 'options must be a Hash' unless options.kind_of?(Hash) - selector = options[:from] + selector = options.fetch(:from) if options[:multiple] execute_script("$('#{selector}').select2('val', ['#{value}'], true);")