Skip to content

Instantly share code, notes, and snippets.

View cgunther's full-sized avatar

Chris Gunther cgunther

View GitHub Profile
@cgunther
cgunther / agent.rb
Created August 8, 2012 20:18 — forked from lrowe/agent.rb
Ruby file causes SublimeLinter to crash
require 'tempfile'
require 'net/ntlm'
require 'kconv'
require 'webrobots'
##
# An HTTP (and local disk access) user agent. This class is an implementation
# detail and is subject to change at any time.
class Mechanize::HTTP::Agent
def test_sets_settings_with_hash
user = User.create :name => 'Mr. Foo'
user.settings[:one] = 1
user.settings[:two] = 2
user.settings = { :two => 'two', :three => 3 }
assert_equal 1, user.settings[:one]
assert_equal 'two', user.settings[:two]
assert_equal 3, user.settings[:three] # ensure existing settings remain intact
end