Skip to content

Instantly share code, notes, and snippets.

@cored
Created March 3, 2014 20:12
Show Gist options
  • Save cored/9333605 to your computer and use it in GitHub Desktop.
Save cored/9333605 to your computer and use it in GitHub Desktop.
require_relative '../../lib/attachment_timeout_increaser'
require 'minitest/autorun'
class AttachmentTimeoutIncreaserTest < MiniTest::Unit::TestCase
def setup
@timeout = 300
@imap_connection = MiniTest::Mock.new
end
def @imap_connection.timeout
0
end
def test_increase_if_timeout_less_than_300
@imap_connection.expect :timeout=, true, [@timeout]
@imap_connection.stub :timeout, 100 do
AttachmentTimeoutIncreaser.increase(@imap_connection)
@imap_connection.verify
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment