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

Version Path
fiveruns-dash-ruby-0.7.0 test/update_test.rb
fiveruns-dash-ruby-0.7.1 test/update_test.rb
fiveruns-dash-ruby-0.7.2 test/update_test.rb
fiveruns-dash-ruby-0.7.3 test/update_test.rb
fiveruns-dash-ruby-0.7.4 test/update_test.rb
fiveruns-dash-ruby-0.7.5 test/update_test.rb
fiveruns-dash-ruby-0.7.6 test/update_test.rb
fiveruns-dash-ruby-0.8.0 test/update_test.rb
fiveruns-dash-ruby-0.8.1 test/update_test.rb
fiveruns-dash-ruby-0.8.10 test/update_test.rb
fiveruns-dash-ruby-0.8.3 test/update_test.rb
fiveruns-dash-ruby-0.8.4 test/update_test.rb
fiveruns-dash-ruby-0.8.5 test/update_test.rb
fiveruns-dash-ruby-0.8.6 test/update_test.rb
fiveruns-dash-ruby-0.8.8 test/update_test.rb
fiveruns-dash-ruby-0.8.9 test/update_test.rb