Skip to content

Commit

Permalink
Cleanup package tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Fauser committed Mar 11, 2009
1 parent a1bec7b commit 203949f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Cleanup package tests [cody]
* Remove unused Carrier#setup method [cody]
* Don't use Array splat in Regex comparisons in Package [cody]
* Default the Location to use the :alpha2 country code format [cody]
Expand Down
31 changes: 12 additions & 19 deletions test/unit/package_test.rb
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
require File.dirname(__FILE__) + '/../test_helper'

class PackageTest < Test::Unit::TestCase
include ActiveMerchant::Shipping


GRAMS_IN_AN_OUNCE = 28.349523125
OUNCES_IN_A_GRAM = 0.0352739619495804
INCHES_IN_A_CM = 0.393700787401575
CM_IN_AN_INCH = 2.54

def setup
@imperial_package = Package.new(65, [3,6,8.5],
:units => :imperial,
:value => 10.65,
:currency => 'USD'
)

@metric_package = Package.new(100, [5,18.5,40],
:value => 860,
:currency => 'CAD'
@imperial_package = Package.new(65, [3,6,8.5],
:units => :imperial,
:value => 10.65,
:currency => 'USD'
)

@packages = TestFixtures.packages
end

def test_initialize
assert_raise ArgumentError do
Package.new
end

@metric_package = Package.new(100, [5,18.5,40],
:value => 860,
:currency => 'CAD'
)

@packages = TestFixtures.packages
end

def test_accessors
Expand Down

0 comments on commit 203949f

Please sign in to comment.