sugarcube 1.1.0 → 1.3.0

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.
@@ -28,28 +28,96 @@ describe "UIView" do
28
28
  image.scale.should == UIScreen.mainScreen.scale
29
29
  end
30
30
 
31
- it "should convert bounds" do
32
- view1 = UIView.alloc.initWithFrame([[0, 0], [100, 100]])
33
- view2 = UIView.alloc.initWithFrame([[10, 5], [80, 90]])
34
- view1 << view2
35
- view3 = UIView.alloc.initWithFrame([[10, 5], [60, 80]])
36
- view2 << view3
37
- frame = view3.convert_bounds(view1)
38
- frame.origin.x.should == 20
39
- frame.origin.y.should == 10
40
- frame.size.width.should == 60
41
- frame.size.height.should == 80
42
- end
43
-
44
- it "should convert point" do
45
- view1 = UIView.alloc.initWithFrame([[0, 0], [100, 100]])
46
- view2 = UIView.alloc.initWithFrame([[10, 5], [80, 90]])
47
- view1 << view2
48
- view3 = UIView.alloc.initWithFrame([[10, 5], [60, 80]])
49
- view2 << view3
50
- point = view3.convert_origin(view1)
51
- point.x.should == 20
52
- point.y.should == 10
31
+ describe "should convert bounds" do
32
+ before do
33
+ @view1 = UIView.alloc.initWithFrame([[0, 0], [100, 100]])
34
+ @view2 = UIView.alloc.initWithFrame([[10, 5], [80, 90]])
35
+ @view1 << @view2
36
+ @view3 = UIView.alloc.initWithFrame([[10, 5], [60, 80]])
37
+ @view2 << @view3
38
+ end
39
+
40
+ it "should convert_frame_to" do
41
+ frame = @view3.convert_frame_to(@view1)
42
+ frame.origin.x.should == 20
43
+ frame.origin.y.should == 10
44
+ frame.size.width.should == 60
45
+ frame.size.height.should == 80
46
+ end
47
+
48
+ it "should convert_frame_from" do
49
+ frame = @view1.convert_frame_from(@view3)
50
+ frame.origin.x.should == 20
51
+ frame.origin.y.should == 10
52
+ frame.size.width.should == 60
53
+ frame.size.height.should == 80
54
+ end
55
+ end
56
+
57
+ describe "should convert point" do
58
+ before do
59
+ @view1 = UIView.alloc.initWithFrame([[0, 0], [100, 100]])
60
+ @view2 = UIView.alloc.initWithFrame([[10, 5], [80, 90]])
61
+ @view1 << @view2
62
+ @view3 = UIView.alloc.initWithFrame([[10, 5], [60, 80]])
63
+ @view2 << @view3
64
+ end
65
+
66
+ it "should convert_origin_to" do
67
+ point = @view3.convert_origin_to(@view1)
68
+ point.x.should == 20
69
+ point.y.should == 10
70
+ end
71
+
72
+ it "should convert_origin_from" do
73
+ point = @view1.convert_origin_from(@view3)
74
+ point.x.should == 20
75
+ point.y.should == 10
76
+ end
77
+ end
78
+
79
+ it "should return x" do
80
+ view = UIView.alloc.initWithFrame([[100, 200], [300, 400]])
81
+ view.x.should == view.frame.origin.x
82
+ end
83
+
84
+ it "should set x" do
85
+ view = UIView.alloc.initWithFrame([[100, 200], [300, 400]])
86
+ view.x = 500
87
+ view.x.should == 500
88
+ end
89
+
90
+ it "should return y" do
91
+ view = UIView.alloc.initWithFrame([[100, 200], [300, 400]])
92
+ view.y.should == view.frame.origin.y
93
+ end
94
+
95
+ it "should set y" do
96
+ view = UIView.alloc.initWithFrame([[100, 200], [300, 400]])
97
+ view.y = 500
98
+ view.y.should == 500
99
+ end
100
+
101
+ it "should return width" do
102
+ view = UIView.alloc.initWithFrame([[100, 200], [300, 400]])
103
+ view.width.should == view.frame.size.width
104
+ end
105
+
106
+ it "should set width" do
107
+ view = UIView.alloc.initWithFrame([[100, 200], [300, 400]])
108
+ view.width = 500
109
+ view.width.should == 500
110
+ end
111
+
112
+ it "should return height" do
113
+ view = UIView.alloc.initWithFrame([[100, 200], [300, 400]])
114
+ view.height.should == view.frame.size.height
115
+ end
116
+
117
+ it "should set height" do
118
+ view = UIView.alloc.initWithFrame([[100, 200], [300, 400]])
119
+ view.height = 500
120
+ view.height.should == 500
53
121
  end
54
122
 
55
123
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sugarcube
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-08-23 00:00:00.000000000 Z
15
+ date: 2013-10-09 00:00:00.000000000 Z
16
16
  dependencies: []
17
17
  description: ! '== Description
18
18
 
@@ -57,6 +57,8 @@ files:
57
57
  - lib/sugarcube-all.rb
58
58
  - lib/sugarcube-animations.rb
59
59
  - lib/sugarcube-animations/animation_chain.rb
60
+ - lib/sugarcube-animations/caanimation.rb
61
+ - lib/sugarcube-animations/calayer.rb
60
62
  - lib/sugarcube-animations/uiview.rb
61
63
  - lib/sugarcube-anonymous.rb
62
64
  - lib/sugarcube-anonymous/anonymous.rb
@@ -133,10 +135,10 @@ files:
133
135
  - lib/sugarcube-nsdata/uiimage.rb
134
136
  - lib/sugarcube-nsdate.rb
135
137
  - lib/sugarcube-nsdate/date_parser.rb
136
- - lib/sugarcube-nsdate/fixnum.rb
137
138
  - lib/sugarcube-nsdate/nsdate.rb
138
139
  - lib/sugarcube-nsdate/nsdate_delta.rb
139
140
  - lib/sugarcube-nsdate/nsstring.rb
141
+ - lib/sugarcube-nsdate/numeric.rb
140
142
  - lib/sugarcube-nsuserdefaults.rb
141
143
  - lib/sugarcube-nsuserdefaults/nsuserdefaults.rb
142
144
  - lib/sugarcube-numbers.rb
@@ -237,7 +239,9 @@ files:
237
239
  - spec/uiactionsheet_spec.rb
238
240
  - spec/uialertview_spec.rb
239
241
  - spec/uibarbuttonitem_spec.rb
242
+ - spec/uicolor_spec.rb
240
243
  - spec/uicontrol_spec.rb
244
+ - spec/uiimage_spec.rb
241
245
  - spec/uilabel_spec.rb
242
246
  - spec/uitableviewcell_spec.rb
243
247
  - spec/uiview_animation_spec.rb
@@ -312,7 +316,9 @@ test_files:
312
316
  - spec/uiactionsheet_spec.rb
313
317
  - spec/uialertview_spec.rb
314
318
  - spec/uibarbuttonitem_spec.rb
319
+ - spec/uicolor_spec.rb
315
320
  - spec/uicontrol_spec.rb
321
+ - spec/uiimage_spec.rb
316
322
  - spec/uilabel_spec.rb
317
323
  - spec/uitableviewcell_spec.rb
318
324
  - spec/uiview_animation_spec.rb