simple-view 0.1.3 → 0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +14 -7
- data/Rakefile +3 -7
- data/app/app_delegate.rb +2 -0
- data/app/simple_view_controller.rb +33 -15
- data/app/user_info_controller.rb +67 -0
- data/app/view_anchoring_controller.rb +27 -0
- data/lib/simple-view.rb +1 -7
- data/lib/simple_view/extensions/fixnum.rb +9 -0
- data/lib/simple_view/extensions/string.rb +16 -3
- data/lib/simple_view/extensions/ui_color.rb +2 -2
- data/lib/simple_view/extensions/ui_font.rb +2 -2
- data/lib/simple_view/extensions/ui_image.rb +2 -2
- data/lib/simple_view/extensions/ui_view.rb +48 -81
- data/lib/simple_view/layout.rb +1 -1
- data/lib/simple_view/styles.rb +4 -4
- data/lib/simple_view/version.rb +1 -1
- data/lib/simple_view/view_builder.rb +250 -0
- data/lib/simple_view/view_proxy.rb +22 -44
- data/spec/acceptance/view_anchoring_controller_spec.rb +82 -0
- data/spec/extensions/fixnum_spec.rb +15 -0
- data/spec/extensions/string_spec.rb +1 -1
- data/spec/extensions/ui_color_spec.rb +1 -1
- data/spec/extensions/ui_font_spec.rb +1 -1
- data/spec/extensions/ui_image_spec.rb +1 -1
- data/spec/extensions/ui_view_spec.rb +1 -17
- data/spec/layout_spec.rb +15 -0
- data/spec/styles_spec.rb +17 -0
- data/spec/view_builder_spec.rb +229 -0
- data/spec/view_proxy_spec.rb +172 -0
- metadata +18 -44
- data/lib/simple_view/builders/helpers/has_background_color.rb +0 -10
- data/lib/simple_view/builders/helpers/has_color.rb +0 -9
- data/lib/simple_view/builders/helpers/has_font.rb +0 -9
- data/lib/simple_view/builders/helpers/has_text_color.rb +0 -11
- data/lib/simple_view/builders/helpers/has_tint_color.rb +0 -10
- data/lib/simple_view/builders/ui_activity_indicator_view_builder.rb +0 -12
- data/lib/simple_view/builders/ui_button_builder.rb +0 -32
- data/lib/simple_view/builders/ui_control_builder.rb +0 -9
- data/lib/simple_view/builders/ui_image_view_builder.rb +0 -38
- data/lib/simple_view/builders/ui_label_builder.rb +0 -18
- data/lib/simple_view/builders/ui_progress_view_builder.rb +0 -28
- data/lib/simple_view/builders/ui_search_bar_builder.rb +0 -31
- data/lib/simple_view/builders/ui_segmented_control_builder.rb +0 -28
- data/lib/simple_view/builders/ui_slider_builder.rb +0 -52
- data/lib/simple_view/builders/ui_switch_builder.rb +0 -10
- data/lib/simple_view/builders/ui_tab_bar_builder.rb +0 -20
- data/lib/simple_view/builders/ui_table_view_builder.rb +0 -15
- data/lib/simple_view/builders/ui_table_view_cell_builder.rb +0 -19
- data/lib/simple_view/builders/ui_text_field_builder.rb +0 -8
- data/lib/simple_view/builders/ui_text_view_builder.rb +0 -8
- data/lib/simple_view/builders/ui_toolbar_builder.rb +0 -11
- data/lib/simple_view/builders/ui_view_builder.rb +0 -58
- data/spec/builders/ui_activity_indicator_view_builder_spec.rb +0 -12
- data/spec/builders/ui_button_builder_spec.rb +0 -12
- data/spec/builders/ui_control_builder_spec.rb +0 -5
- data/spec/builders/ui_image_view_builder_spec.rb +0 -31
- data/spec/builders/ui_progress_view_builder_spec.rb +0 -12
- data/spec/builders/ui_segmented_control_builder_spec.rb +0 -13
- data/spec/builders/ui_table_view_builder_spec.rb +0 -12
- data/spec/builders/ui_table_view_cell_builder_spec.rb +0 -17
- data/spec/builders/ui_view_builder_spec.rb +0 -35
- data/spec/simple_view_spec.rb +0 -193
@@ -0,0 +1,15 @@
|
|
1
|
+
describe "SimpleView::FixnumExtensions" do
|
2
|
+
describe "#percent" do
|
3
|
+
it "should return 1 for 100%" do
|
4
|
+
100.percent.should == 1
|
5
|
+
end
|
6
|
+
|
7
|
+
it "should return 0.5 for 50%" do
|
8
|
+
50.percent.should == 0.5
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should return 0 for 0%" do
|
12
|
+
0.percent.should == 0
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
describe "SimpleView::
|
1
|
+
describe "SimpleView::UIViewExtensions" do
|
2
2
|
describe "name accessor" do
|
3
3
|
it "should get and set view name" do
|
4
4
|
view = UIView.alloc.initWithFrame(CGRectZero)
|
@@ -14,28 +14,12 @@ describe "SimpleView::UIView" do
|
|
14
14
|
view.left.should == 10
|
15
15
|
end
|
16
16
|
|
17
|
-
it "should set right" do
|
18
|
-
superview = UIView.alloc.initWithFrame(CGRectMake(0, 0, 100, 100))
|
19
|
-
view = UIView.alloc.initWithFrame(CGRectZero)
|
20
|
-
superview.addSubview(view)
|
21
|
-
view.right = 10
|
22
|
-
view.right.should == 10
|
23
|
-
end
|
24
|
-
|
25
17
|
it "should set top" do
|
26
18
|
view = UIView.alloc.initWithFrame(CGRectZero)
|
27
19
|
view.top = 11
|
28
20
|
view.top.should == 11
|
29
21
|
end
|
30
22
|
|
31
|
-
it "should set bottom" do
|
32
|
-
superview = UIView.alloc.initWithFrame(CGRectMake(0, 0, 100, 100))
|
33
|
-
view = UIView.alloc.initWithFrame(CGRectZero)
|
34
|
-
superview.addSubview(view)
|
35
|
-
view.bottom = 10
|
36
|
-
view.bottom.should == 10
|
37
|
-
end
|
38
|
-
|
39
23
|
it "should set width" do
|
40
24
|
view = UIView.alloc.initWithFrame(CGRectZero)
|
41
25
|
view.width = 12
|
data/spec/layout_spec.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
describe "SimpleView::Layout" do
|
2
|
+
describe "#setup" do
|
3
|
+
class DummyController
|
4
|
+
include SimpleView::Layout
|
5
|
+
end
|
6
|
+
|
7
|
+
it "should execute the block within view's scope" do
|
8
|
+
view = UIView.alloc.initWithFrame(CGRectZero)
|
9
|
+
DummyController.new.setup view do
|
10
|
+
view.frame = CGRectMake(0, 0, 10, 10)
|
11
|
+
end
|
12
|
+
view.frame.should == CGRectMake(0, 0, 10, 10)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/spec/styles_spec.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
describe "SimpleView::Styles" do
|
2
|
+
it "should be able to define new style" do
|
3
|
+
style = {color: :red}
|
4
|
+
|
5
|
+
SimpleView::Styles.define :test, style
|
6
|
+
SimpleView::Styles.for(:test).should == style
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should be able to extend existing style" do
|
10
|
+
style = {color: :red}
|
11
|
+
style_ex = {size: 1}
|
12
|
+
|
13
|
+
SimpleView::Styles.define :test, style
|
14
|
+
SimpleView::Styles.define :test, style_ex
|
15
|
+
SimpleView::Styles.for(:test).should == {color: :red, size: 1}
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,229 @@
|
|
1
|
+
describe "SimpleView::ViewBuilder" do
|
2
|
+
describe "UIViewBuilder" do
|
3
|
+
it "should build UIView" do
|
4
|
+
SimpleView::ViewBuilder.view_for(UIView).class.should == UIView
|
5
|
+
end
|
6
|
+
|
7
|
+
describe "#size_within" do
|
8
|
+
it "should set width by percentage" do
|
9
|
+
view = SimpleView::ViewBuilder.view_for UIView, CGRectMake(0, 0, 320, 480), width: 100.percent
|
10
|
+
view.width.should == 320
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should set width by value" do
|
14
|
+
view = SimpleView::ViewBuilder.view_for UIView, CGRectMake(0, 0, 320, 480), width: 100
|
15
|
+
view.width.should == 100
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should set width by left and right" do
|
19
|
+
view = SimpleView::ViewBuilder.view_for UIView, CGRectMake(0, 0, 320, 480), left: 10, right: 20
|
20
|
+
view.width.should == 290
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should set height by percentage" do
|
24
|
+
view = SimpleView::ViewBuilder.view_for UIView, CGRectMake(0, 0, 320, 480), height: 100.percent
|
25
|
+
view.height.should == 480
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should set height by value" do
|
29
|
+
view = SimpleView::ViewBuilder.view_for UIView, CGRectMake(0, 0, 320, 480), height: 100
|
30
|
+
view.height.should == 100
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should set height by top and bottom" do
|
34
|
+
view = SimpleView::ViewBuilder.view_for UIView, CGRectMake(0, 0, 320, 480), top: 10, bottom: 20
|
35
|
+
view.height.should == 450
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe "#backgroundColor" do
|
40
|
+
it "should set backgroundColor by HTML code" do
|
41
|
+
view = SimpleView::ViewBuilder.view_for(UIView, backgroundColor: "#f00")
|
42
|
+
|
43
|
+
r = Pointer.new(:float)
|
44
|
+
g = Pointer.new(:float)
|
45
|
+
b = Pointer.new(:float)
|
46
|
+
a = Pointer.new(:float)
|
47
|
+
view.backgroundColor.getRed(r, green: g, blue: b, alpha: a)
|
48
|
+
r[0].should == 1
|
49
|
+
g[0].should == 0
|
50
|
+
b[0].should == 0
|
51
|
+
a[0].should == 1
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should set background_color by HTML code" do
|
55
|
+
view = SimpleView::ViewBuilder.view_for(UIView, background_color: "#f00")
|
56
|
+
|
57
|
+
r = Pointer.new(:float)
|
58
|
+
g = Pointer.new(:float)
|
59
|
+
b = Pointer.new(:float)
|
60
|
+
a = Pointer.new(:float)
|
61
|
+
view.backgroundColor.getRed(r, green: g, blue: b, alpha: a)
|
62
|
+
r[0].should == 1
|
63
|
+
g[0].should == 0
|
64
|
+
b[0].should == 0
|
65
|
+
a[0].should == 1
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe "UIActionSheet" do
|
71
|
+
it "should build UIActionSheet" do
|
72
|
+
view = SimpleView::ViewBuilder.view_for(UIActionSheet)
|
73
|
+
view.class.should == UIActionSheet
|
74
|
+
end
|
75
|
+
|
76
|
+
it "should build UIActionSheet with title" do
|
77
|
+
view = SimpleView::ViewBuilder.view_for(UIActionSheet, title: 'title')
|
78
|
+
view.class.should == UIActionSheet
|
79
|
+
view.title.should == 'title'
|
80
|
+
end
|
81
|
+
|
82
|
+
it "should build UIActionSheet with delegate" do
|
83
|
+
delegate = Object.new
|
84
|
+
view = SimpleView::ViewBuilder.view_for(UIActionSheet, delegate: delegate)
|
85
|
+
view.class.should == UIActionSheet
|
86
|
+
view.delegate.should == delegate
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should build UIActionSheet with cancel title" do
|
90
|
+
view = SimpleView::ViewBuilder.view_for(UIActionSheet, cancel_button_title: 'cancel')
|
91
|
+
view.class.should == UIActionSheet
|
92
|
+
view.buttonTitleAtIndex(view.cancelButtonIndex).should == 'cancel'
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should build UIActionSheet with destructive title" do
|
96
|
+
view = SimpleView::ViewBuilder.view_for(UIActionSheet, destructive_button_title: 'destroy')
|
97
|
+
view.class.should == UIActionSheet
|
98
|
+
view.buttonTitleAtIndex(view.destructiveButtonIndex).should == 'destroy'
|
99
|
+
end
|
100
|
+
|
101
|
+
it "should build UIActionSheet with other title" do
|
102
|
+
view = SimpleView::ViewBuilder.view_for(UIActionSheet, other_button_titles: 'others')
|
103
|
+
view.class.should == UIActionSheet
|
104
|
+
view.buttonTitleAtIndex(view.firstOtherButtonIndex).should == 'others'
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
describe "UIActivityIndicatorView" do
|
109
|
+
it "should build UIActivityIndicatorView" do
|
110
|
+
view = SimpleView::ViewBuilder.view_for(UIActivityIndicatorView)
|
111
|
+
view.class.should == UIActivityIndicatorView
|
112
|
+
view.activityIndicatorViewStyle.should == UIActivityIndicatorViewStyleWhite
|
113
|
+
end
|
114
|
+
|
115
|
+
it "should build UIActivityIndicatorView with style" do
|
116
|
+
view = SimpleView::ViewBuilder.view_for(UIActivityIndicatorView, style: UIActivityIndicatorViewStyleGray)
|
117
|
+
view.activityIndicatorViewStyle.should == UIActivityIndicatorViewStyleGray
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
describe "UIButtonBuilder" do
|
122
|
+
it "should build UIButton" do
|
123
|
+
button = SimpleView::ViewBuilder.view_for(UIButton)
|
124
|
+
button.class.should == UIRoundedRectButton
|
125
|
+
button.buttonType.should == UIButtonTypeRoundedRect
|
126
|
+
end
|
127
|
+
|
128
|
+
it "should build UIButton with buttonType" do
|
129
|
+
button = SimpleView::ViewBuilder.view_for(UIButton, buttonType: UIButtonTypeDetailDisclosure)
|
130
|
+
button.buttonType.should == UIButtonTypeDetailDisclosure
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
describe "UIControlBuilder" do
|
135
|
+
it "should build UIControl" do
|
136
|
+
SimpleView::ViewBuilder.view_for(UIControl).class.should == UIControl
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
describe "UIImageViewBuilder" do
|
141
|
+
it "should build UIImageView" do
|
142
|
+
image_view = SimpleView::ViewBuilder.view_for(UIImageView)
|
143
|
+
image_view.class.should == UIImageView
|
144
|
+
end
|
145
|
+
|
146
|
+
it "should build UIImageView with image" do
|
147
|
+
image = UIImage.imageNamed "test.jpg"
|
148
|
+
image_view = SimpleView::ViewBuilder.view_for(UIImageView, image: image)
|
149
|
+
image_view.image.should == image
|
150
|
+
end
|
151
|
+
|
152
|
+
it "should build UIImageView with image string" do
|
153
|
+
image_view = SimpleView::ViewBuilder.view_for(UIImageView, image: "test.jpg")
|
154
|
+
image_view.image.class.should == UIImage
|
155
|
+
end
|
156
|
+
|
157
|
+
it "should build UIImageView with image and highlightedImage" do
|
158
|
+
image = UIImage.imageNamed "test.jpg"
|
159
|
+
highlighted = UIImage.imageNamed "test.jpg"
|
160
|
+
image_view = SimpleView::ViewBuilder.view_for(UIImageView, image: image, highlightedImage: highlighted)
|
161
|
+
image_view.image.should == image
|
162
|
+
image_view.highlightedImage.should == highlighted
|
163
|
+
end
|
164
|
+
|
165
|
+
it "should build UIImageView with image string and highlightedImage string" do
|
166
|
+
image_view = SimpleView::ViewBuilder.view_for(UIImageView, image: "test.jpg", highlightedImage: "test.jpg")
|
167
|
+
image_view.image.class.should == UIImage
|
168
|
+
image_view.highlightedImage.class.should == UIImage
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
describe "UIProgressViewBuilder" do
|
173
|
+
it "should build UIProgressView" do
|
174
|
+
view = SimpleView::ViewBuilder.view_for(UIProgressView)
|
175
|
+
view.class.should == UIProgressView
|
176
|
+
view.progressViewStyle.should == UIProgressViewStyleDefault
|
177
|
+
end
|
178
|
+
|
179
|
+
it "should build UIProgressView with style" do
|
180
|
+
view = SimpleView::ViewBuilder.view_for(UIProgressView, style: UIProgressViewStyleBar)
|
181
|
+
view.progressViewStyle.should == UIProgressViewStyleBar
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
describe "UISegmentedControlBuilder" do
|
186
|
+
it "should build UISegmentedControl" do
|
187
|
+
view = SimpleView::ViewBuilder.view_for(UISegmentedControl)
|
188
|
+
view.class.should == UISegmentedControl
|
189
|
+
view.numberOfSegments.should == 0
|
190
|
+
end
|
191
|
+
|
192
|
+
it "should build UISegmentedControl with items" do
|
193
|
+
items = ["ABC"]
|
194
|
+
view = SimpleView::ViewBuilder.view_for(UISegmentedControl, items: items)
|
195
|
+
view.numberOfSegments.should == 1
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
describe "UITableViewBuilder" do
|
200
|
+
it "should build UITableView" do
|
201
|
+
view = SimpleView::ViewBuilder.view_for(UITableView)
|
202
|
+
view.class.should == UITableView
|
203
|
+
view.style.should == UITableViewStylePlain
|
204
|
+
end
|
205
|
+
|
206
|
+
it "should build UITableView with style" do
|
207
|
+
view = SimpleView::ViewBuilder.view_for(UITableView, style: UITableViewStyleGrouped)
|
208
|
+
view.style.should == UITableViewStyleGrouped
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
describe "UITableViewCellBuilder" do
|
213
|
+
it "should build UITableViewCell" do
|
214
|
+
view = SimpleView::ViewBuilder.view_for(UITableViewCell)
|
215
|
+
view.class.should == UITableViewCell
|
216
|
+
view.style.should == UITableViewCellStyleDefault
|
217
|
+
end
|
218
|
+
|
219
|
+
it "should build UITableViewCell with style" do
|
220
|
+
view = SimpleView::ViewBuilder.view_for(UITableViewCell, style: UITableViewCellStyleSubtitle)
|
221
|
+
view.style.should == UITableViewCellStyleSubtitle
|
222
|
+
end
|
223
|
+
|
224
|
+
it "should build UITableViewCell with style and reuseIdentifier" do
|
225
|
+
view = SimpleView::ViewBuilder.view_for(UITableViewCell, reuseIdentifier: "CellIdentifier")
|
226
|
+
view.reuseIdentifier.should == "CellIdentifier"
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
@@ -0,0 +1,172 @@
|
|
1
|
+
describe "SimpleView::ViewProxy" do
|
2
|
+
it "should convert locals to instance variables" do
|
3
|
+
view = UIView.alloc.init
|
4
|
+
local_a = Object.new
|
5
|
+
local_b = Object.new
|
6
|
+
|
7
|
+
proxy = SimpleView::ViewProxy.new(view, local_a: local_a, local_b: local_b)
|
8
|
+
|
9
|
+
proxy.view.should == view
|
10
|
+
proxy.local_a.should == local_a
|
11
|
+
proxy.local_b.should == local_b
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#add" do
|
15
|
+
it "should add view with options" do
|
16
|
+
alpha = 0.5
|
17
|
+
backgroundColor = UIColor.redColor
|
18
|
+
|
19
|
+
proxy = SimpleView::ViewProxy.new
|
20
|
+
view = proxy.add UIView, top: 0, left: 0, width: 10, height: 10, alpha: alpha, backgroundColor: backgroundColor
|
21
|
+
view.frame.should == CGRectMake(0, 0, 10, 10)
|
22
|
+
view.alpha.should == alpha
|
23
|
+
view.backgroundColor.should == backgroundColor
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "#add with predefined styles" do
|
27
|
+
it "should add view with default style" do
|
28
|
+
SimpleView::Styles.define UIView, backgroundColor: UIColor.redColor
|
29
|
+
|
30
|
+
proxy = SimpleView::ViewProxy.new
|
31
|
+
view = proxy.add UIView
|
32
|
+
view.backgroundColor.should == UIColor.redColor
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should add view with custom style" do
|
36
|
+
SimpleView::Styles.define :blue, backgroundColor: UIColor.blueColor
|
37
|
+
|
38
|
+
proxy = SimpleView::ViewProxy.new
|
39
|
+
view = proxy.add UIView, styles: :blue
|
40
|
+
view.backgroundColor.should == UIColor.blueColor
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should add view with multiple custom styles" do
|
44
|
+
SimpleView::Styles.define :blue, backgroundColor: UIColor.blueColor
|
45
|
+
SimpleView::Styles.define :alpha, alpha: 0.5
|
46
|
+
|
47
|
+
proxy = SimpleView::ViewProxy.new
|
48
|
+
view = proxy.add UIView, styles: [:blue, :alpha]
|
49
|
+
view.backgroundColor.should == UIColor.blueColor
|
50
|
+
view.alpha.should == 0.5
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should add view with custom style overriding default style" do
|
54
|
+
SimpleView::Styles.define UIView, backgroundColor: UIColor.redColor
|
55
|
+
SimpleView::Styles.define :blue, backgroundColor: UIColor.blueColor
|
56
|
+
|
57
|
+
proxy = SimpleView::ViewProxy.new
|
58
|
+
view = proxy.add UIView, styles: :blue
|
59
|
+
view.backgroundColor.should == UIColor.blueColor
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should execute block" do
|
64
|
+
proxy = SimpleView::ViewProxy.new
|
65
|
+
view = proxy.add UIView do
|
66
|
+
label
|
67
|
+
end
|
68
|
+
view.subviews.first.class.should == UILabel
|
69
|
+
end
|
70
|
+
|
71
|
+
it "should add view to superview" do
|
72
|
+
super_view = UIView.alloc.init
|
73
|
+
proxy = SimpleView::ViewProxy.new(super_view)
|
74
|
+
subview = proxy.add UIView
|
75
|
+
super_view.subviews.first.should == subview
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
describe "shorthand methods" do
|
80
|
+
before do
|
81
|
+
@proxy = SimpleView::ViewProxy.new
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should create UIActionSheet" do
|
85
|
+
@proxy.action_sheet.class.should == UIActionSheet
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should create UIActivityIndicatorView" do
|
89
|
+
@proxy.activity_indicator_view.class.should == UIActivityIndicatorView
|
90
|
+
end
|
91
|
+
|
92
|
+
it "should create UIButton" do
|
93
|
+
@proxy.button.class.should == UIRoundedRectButton
|
94
|
+
end
|
95
|
+
|
96
|
+
it "should create UIDatePicker" do
|
97
|
+
@proxy.date_picker.class.should == UIDatePicker
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should create UIImageView" do
|
101
|
+
@proxy.image_view.class.should == UIImageView
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should create UILabel" do
|
105
|
+
@proxy.label.class.should == UILabel
|
106
|
+
end
|
107
|
+
|
108
|
+
it "should create UIPageControl" do
|
109
|
+
@proxy.page_control.class.should == UIPageControl
|
110
|
+
end
|
111
|
+
|
112
|
+
it "should create UIPickerView" do
|
113
|
+
@proxy.picker_view.class.should == UIPickerView
|
114
|
+
end
|
115
|
+
|
116
|
+
it "should create UIProgressView" do
|
117
|
+
@proxy.progress_view.class.should == UIProgressView
|
118
|
+
end
|
119
|
+
|
120
|
+
it "should create UIScrollView" do
|
121
|
+
@proxy.scroll_view.class.should == UIScrollView
|
122
|
+
end
|
123
|
+
|
124
|
+
it "should create UISearchBar" do
|
125
|
+
@proxy.search_bar.class.should == UISearchBar
|
126
|
+
end
|
127
|
+
|
128
|
+
it "should create UISegmentedControl" do
|
129
|
+
@proxy.segmented_control.class.should == UISegmentedControl
|
130
|
+
end
|
131
|
+
|
132
|
+
it "should create UISlider" do
|
133
|
+
@proxy.slider.class.should == UISlider
|
134
|
+
end
|
135
|
+
|
136
|
+
it "should create UIStepper" do
|
137
|
+
@proxy.stepper.class.should == UIStepper
|
138
|
+
end
|
139
|
+
|
140
|
+
it "should create UISwitch" do
|
141
|
+
@proxy.switch.class.should == UISwitch
|
142
|
+
end
|
143
|
+
|
144
|
+
it "should create UITabBar" do
|
145
|
+
@proxy.tab_bar.class.should == UITabBar
|
146
|
+
end
|
147
|
+
|
148
|
+
it "should create UITableView" do
|
149
|
+
@proxy.table_view.class.should == UITableView
|
150
|
+
end
|
151
|
+
|
152
|
+
it "should create UITableViewCell" do
|
153
|
+
@proxy.table_view_cell.class.should == UITableViewCell
|
154
|
+
end
|
155
|
+
|
156
|
+
it "should create UITextField" do
|
157
|
+
@proxy.text_field.class.should == UITextField
|
158
|
+
end
|
159
|
+
|
160
|
+
it "should create UITextView" do
|
161
|
+
@proxy.text_view.class.should == UITextView
|
162
|
+
end
|
163
|
+
|
164
|
+
it "should create UIToolbar" do
|
165
|
+
@proxy.toolbar.class.should == UIToolbar
|
166
|
+
end
|
167
|
+
|
168
|
+
it "should create UIWebView" do
|
169
|
+
@proxy.web_view.class.should == UIWebView
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|