Sha256: 82f91903e7513d1febbacd372a8b45a9e2881fb80df2f411299a902f7493395e
Contents?: true
Size: 1 KB
Versions: 16
Compression:
Stored size: 1 KB
Contents
require File.dirname(__FILE__) << "/test_helper" class UpdateTest < Test::Unit::TestCase context "Update" do setup do @update = Update.new(DataPayload.new({})) end context "an instance" do context "GUID" do setup do @mock_pid = 'THE-PID' flexmock(Process).should_receive(:pid).and_return(@mock_pid) end should "include PID" do @update.guid.include?(@mock_pid) end should "start with a a timestamp" do @update.guid[/^\d{10,}/] end should "be cached per instance" do assert_equal @update.guid, @update.guid end end context "storing data" do setup do @urls = %w(file:///tmp http://yahoo.com https://secure.thing.com) end should "find correct method" do assert_equal [:file, :http, :http], @urls.map { |url| @update.send(:storage_method_for, URI.parse(url).scheme) } end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems