diff --git a/lib/capybara/session.rb b/lib/capybara/session.rb
index <HASH>..<HASH> 100644
--- a/lib/capybara/session.rb
+++ b/lib/capybara/session.rb
@@ -62,7 +62,7 @@ module Capybara
 
     def fill_in(locator, options={})
       msg = "cannot fill in, no text field, text area or password field with id, name, or label '#{locator}' found"
-      raise "Must pass a hash containing 'with'" unless options.kind_of? Hash && !options.index(:with).nil?
+      raise "Must pass a hash containing 'with'" if not options.is_a?(Hash) or not options.has_key?(:with)
       locate(:xpath, XPath.fillable_field(locator), msg).set(options[:with])
     end
unless is never a good idea