Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
renamed gem using @drbrain's conventions : http://blog.segment7.net/a…
- Loading branch information
1 parent
e7bf061
commit fcc35ee
Showing
7 changed files
with
52 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require "test/unit" | ||
require "new_base_60" | ||
|
||
class TestNew_base_60 < Test::Unit::TestCase | ||
def test_base60_to_base10 | ||
assert_equal New_base_60.new("464").to_i, 14764 | ||
assert_not_equal New_base_60.new("464").to_i, 12345 | ||
end | ||
|
||
def test_base60_to_date | ||
assert_equal New_base_60.new("464").to_date, Date.parse("2010/06/04") | ||
assert_not_equal New_base_60.new("464").to_date, Date.parse("2010/06/05") | ||
end | ||
|
||
def test_date_to_base60 | ||
assert_equal Date.parse("2010/06/04").to_sxg, New_base_60.new("464").to_s | ||
assert_not_equal Date.parse("2010/06/05").to_sxg, New_base_60.new("464") | ||
end | ||
|
||
def test_base10_to_base60 | ||
assert_equal 14764.to_sxg, "464" | ||
assert_not_equal 12345.to_sxg, "464" | ||
end | ||
|
||
def test_base10_to_base60_with_leading_zeroes | ||
assert_equal 14764.to_sxgf(9), "000000464" | ||
assert_not_equal 12345.to_sxgf(9), "000000464" | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.