graft 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,63 +0,0 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
-
3
- module Graft
4
-
5
- class StringTest < Test::Unit::TestCase
6
- context "An instance of the Graft::Type::String class" do
7
-
8
- should_convert 'a string', :to => 'a string'
9
- should_convert '', :to => nil
10
-
11
- end
12
- end
13
-
14
- class BooleanTest < Test::Unit::TestCase
15
- context "An instance of the Graft::Type::Boolean class" do
16
-
17
- should_convert 'true', :to => true
18
- should_convert 'false', :to => false
19
- should_convert '0', :to => false
20
- should_convert '1', :to => true
21
- should_convert '', :to => nil
22
-
23
- should_fail_when_converting 'foo'
24
-
25
- end
26
- end
27
-
28
- class IntegerTest < Test::Unit::TestCase
29
- context "An instance of the Graft::Type::Integer class" do
30
-
31
- should_convert '1', :to => 1
32
- should_convert '', :to => nil
33
-
34
- should_fail_when_converting 'foo'
35
-
36
- end
37
- end
38
-
39
- class DateTest < Test::Unit::TestCase
40
-
41
- context "An instance of the Graft::Type::Date class" do
42
-
43
- should_convert '2008-08-01', :to => Date.parse('2008-08-01')
44
- should_convert '', :to => nil
45
-
46
- end
47
-
48
- end
49
-
50
- class TimeTest < Test::Unit::TestCase
51
-
52
- context "An instance of the Graft::Type::Time class" do
53
-
54
- should_convert '2008-07-28T16:57:10Z', :to => Time.parse('2008-07-28T16:57:10Z')
55
- should_convert '2008-12-25 18:26:55', :to => Time.parse('2008-12-25 18:26:55')
56
- should_convert '1230274722', :to => Time.at(1230274722)
57
- should_convert '', :to => nil
58
-
59
- end
60
-
61
- end
62
-
63
- end