Sha256: a55eff4b61cf419db9fa4761d68d7e8f5be939e88405f6bb234b5df13f7ddb33

Contents?: true

Size: 1.12 KB

Versions: 2

Compression:

Stored size: 1.12 KB

Contents

require 'test_helper'

class PackageTest < Test::Unit::TestCase
  
  context 'initialize' do
    should 'set name to name accessor' do
      package = Divvy::Package.new :michael do
      end
      assert_equal :michael, package.name
    end
    
    should 'convert name strings into symbols' do
      package = Divvy::Package.new 'michael' do
      end
      assert_equal :michael, package.name
    end
        
    should 'set dependencies to an empty array' do
      package = Divvy::Package.new :name do
      end
      assert_equal [], package.dependencies
    end

    should 'set verifications to an empty array' do
      package = Divvy::Package.new :name do
      end
      assert_equal [], package.verifications
    end
    
    should 'assign options to options accessor' do
      options = { :peanut => 'butter jelly time' }
      package = Divvy::Package.new :name, options do
      end
      assert_equal options, package.options
    end

    should 'assign options an empty hash if no options present' do
      package = Divvy::Package.new :name do
      end
      assert_equal Hash.new, package.options
    end
    
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
michaeldwan-divvy-0.1.2 test/package_test.rb
michaeldwan-divvy-0.1.5 test/package_test.rb