xmlss 1.0.0.rc.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,33 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- xmlss (1.0.0.rc.4)
5
- enumeration (~> 1.3)
6
- undies (~> 3.0.0.rc.3)
7
-
8
- GEM
9
- remote: http://rubygems.org/
10
- specs:
11
- ansi (1.4.2)
12
- assert (0.7.3)
13
- assert-view (~> 0.5)
14
- assert-view (0.6.0)
15
- ansi (~> 1.3)
16
- enumeration (1.3.1)
17
- rake (0.9.2)
18
- ruby-prof (0.10.8)
19
- undies (3.0.0.rc.3)
20
- whysoslow (0.0.2)
21
- ansi (~> 1.4)
22
-
23
- PLATFORMS
24
- ruby
25
-
26
- DEPENDENCIES
27
- assert (~> 0.7.3)
28
- assert-view (~> 0.6)
29
- bundler (~> 1.1)
30
- rake (~> 0.9.2)
31
- ruby-prof
32
- whysoslow (~> 0.0)
33
- xmlss!
@@ -1,117 +0,0 @@
1
- require "assert"
2
- require 'enumeration/assert_macros'
3
-
4
- require 'xmlss/element/cell'
5
-
6
- module Xmlss::Element
7
-
8
- class CellTests < Assert::Context
9
- include Enumeration::AssertMacros
10
-
11
- desc "Xmlss::Cell"
12
- before { @c = Cell.new }
13
- subject { @c }
14
-
15
- should be_styled
16
- should have_class_method :writer
17
- should have_accessor :index, :formula, :href, :merge_across, :merge_down
18
-
19
- should have_enum :type, {
20
- :number => "Number",
21
- :date_time => "DateTime",
22
- :boolean => "Boolean",
23
- :string => "String",
24
- :error => "Error"
25
- }
26
-
27
- should have_accessor :data
28
- should have_instance_method :data_xml_value
29
-
30
- should "know its writer hook" do
31
- assert_equal :cell, subject.class.writer
32
- end
33
-
34
- should "set it's defaults" do
35
- assert_nil subject.formula
36
- assert_nil subject.href
37
- assert_nil subject.merge_across
38
- assert_nil subject.merge_down
39
-
40
- assert_equal Cell.type(:string), subject.type
41
- assert_equal "", subject.data
42
- end
43
-
44
- should "bark when setting non Fixnum indices" do
45
- assert_raises ArgumentError do
46
- Cell.new({:index => "do it"})
47
- end
48
- assert_raises ArgumentError do
49
- Cell.new({:index => 2.5})
50
- end
51
- assert_nothing_raised do
52
- Cell.new({:index => 2})
53
- end
54
- end
55
-
56
- should "bark when setting non Fixnum merge attrs" do
57
- assert_raises ArgumentError do
58
- Cell.new({:merge_across => "do it"})
59
- end
60
- assert_raises ArgumentError do
61
- Cell.new({:merge_down => 2.5})
62
- end
63
- assert_nothing_raised do
64
- Cell.new({:merge_across => 2})
65
- end
66
- assert_nothing_raised do
67
- Cell.new({:merge_down => 3})
68
- end
69
- end
70
-
71
- should "nil out merge/index values that are <= 0" do
72
- [:index, :merge_across, :merge_down].each do |a|
73
- assert_equal nil, Cell.new({a => -1}).send(a)
74
- assert_equal nil, Cell.new({a => 0}).send(a)
75
- assert_equal 1, Cell.new({a => 1}).send(a)
76
- end
77
- end
78
-
79
- should "generate it's data xml value" do
80
- assert_equal "12", Cell.new(12).data_xml_value
81
- assert_equal "string", Cell.new(:data => "string").data_xml_value
82
- assert_equal "2011-03-01T00:00:00", Cell.new(DateTime.parse('2011/03/01')).data_xml_value
83
- assert_equal "2011-03-01T00:00:00", Cell.new(Date.parse('2011/03/01')).data_xml_value
84
- time = Time.now
85
- assert_equal time.strftime("%Y-%m-%dT%H:%M:%S"), Cell.new(time).data_xml_value
86
- end
87
-
88
- end
89
-
90
- class ExplicitDataTest < CellTests
91
- desc "when using explicit data type"
92
- subject do
93
- Cell.new(12, {:type => :string})
94
- end
95
-
96
- should "should ignore the data value's implied type" do
97
- assert_equal Cell.type(:string), subject.type
98
- end
99
-
100
- end
101
-
102
- class NoTypeDataTest < CellTests
103
- desc "when no data type is specified"
104
-
105
- should "cast types for Number, DateTime, Boolean, String" do
106
- assert_equal Cell.type(:number), Cell.new(12).type
107
- assert_equal Cell.type(:number), Cell.new(:data => 123.45).type
108
- assert_equal Cell.type(:date_time), Cell.new(Time.now).type
109
- assert_equal Cell.type(:boolean), Cell.new(true).type
110
- assert_equal Cell.type(:boolean), Cell.new(false).type
111
- assert_equal Cell.type(:string), Cell.new("a string").type
112
- assert_equal Cell.type(:string), Cell.new(:data => :symbol).type
113
- end
114
-
115
- end
116
-
117
- end
@@ -1,10 +0,0 @@
1
- require 'assert/setup'
2
-
3
- # this file is required in when the 'irb' rake test is run.
4
- # b/c 'assert' is required above, the test helper will be
5
- # required in.
6
-
7
- # put any IRB setup code here
8
-
9
- require 'xmlss'
10
-
@@ -1,9 +0,0 @@
1
- class Thing
2
- attr_accessor :one, :two, :three, :xml
3
-
4
- include Xmlss::Xml
5
-
6
- def child_nodes
7
- Xmlss::ItemSet.new(:nodes, [])
8
- end
9
- end