diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-22 21:52:41 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-22 21:52:41 +0300 |
commit | 4dbf118a16c7d687894d441d2f2e6165cd0be384 (patch) | |
tree | dacad90db8c80870c873afd8eb4c524a29ec774e | |
parent | 0716a559b5d50fb31a78f6fb68890dacf8940dc9 (diff) |
Fix Style/Not cop violations
-rw-r--r-- | spec/support/select2_helper.rb | 4 |
1 files 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);") |