sugarcube 3.3.0 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ios/sugarcube-factories/uilabel.rb +1 -1
- data/lib/version.rb +1 -1
- data/spec/ios/factories_spec.rb +20 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cbbe819e97283451447a21765514919206aafca
|
4
|
+
data.tar.gz: 441826f0a2a375300361d9271cf18b1080938862
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2f4e84bb18b4146cb59aa1f33dd498ad231c2e992852e863384a35ae4c18e562a5706dcfef06a41194acc73b26754aa5916ca36667d926c28367266e1cba9f4
|
7
|
+
data.tar.gz: 24882269621cdb3f1890bdc4aac91fade6c95bcc1b8baac773e66303e2f861da4e6041c74e25a86ad2aabec1a78f7693956e81add243f0d97b3ac91130da09be
|
@@ -6,7 +6,7 @@ class UILabel
|
|
6
6
|
# UILabel.label('test', 'Helvetica')
|
7
7
|
# UILabel.label('test', 'Helvetica', 20)
|
8
8
|
def self.label(text=nil, font=nil, size=nil)
|
9
|
-
return
|
9
|
+
return new() if text.nil?
|
10
10
|
|
11
11
|
font = font.uifont(size) if font.respond_to?(:uifont)
|
12
12
|
label = self.alloc.initWithFrame([[0, 0], [0, 0]])
|
data/lib/version.rb
CHANGED
data/spec/ios/factories_spec.rb
CHANGED
@@ -2,8 +2,8 @@ describe 'SugarCube Factories' do
|
|
2
2
|
|
3
3
|
describe NSError do
|
4
4
|
[
|
5
|
-
'with message', -> { NSError.
|
6
|
-
'with message and options', -> { NSError.
|
5
|
+
'with message', -> { NSError.error('message') },
|
6
|
+
'with message and options', -> { NSError.error('message', domain: 'Error', code: 1, userInfo: {}) },
|
7
7
|
].each_slice(2) do |description, factory|
|
8
8
|
it "should work #{description}" do
|
9
9
|
error = factory.call
|
@@ -156,13 +156,17 @@ describe 'SugarCube Factories' do
|
|
156
156
|
describe UITableViewCell do
|
157
157
|
[
|
158
158
|
'with #default', -> { UITableViewCell.default('identifier') },
|
159
|
-
'with #default with options', -> { UITableViewCell.default('identifier', accessory: :disclosure,
|
159
|
+
'with #default with options', -> { UITableViewCell.default('identifier', accessory: :disclosure, selection_style: :none, text: 'text', detailText: 'detail') },
|
160
|
+
'with #default with old options (:selection)', -> { UITableViewCell.default('identifier', accessory: :disclosure, selection: :none, text: 'text', detailText: 'detail') },
|
160
161
|
'with #value1', -> { UITableViewCell.value1('identifier') },
|
161
|
-
'with #value1 with options', -> { UITableViewCell.value1('identifier', accessory: :disclosure,
|
162
|
+
'with #value1 with options', -> { UITableViewCell.value1('identifier', accessory: :disclosure, selection_style: :none, text: 'text', detailText: 'detail') },
|
163
|
+
'with #value1 with old options (:selection)', -> { UITableViewCell.value1('identifier', accessory: :disclosure, selection: :none, text: 'text', detailText: 'detail') },
|
162
164
|
'with #value2', -> { UITableViewCell.value2('identifier') },
|
163
|
-
'with #value2 with options', -> { UITableViewCell.value2('identifier', accessory: :disclosure,
|
165
|
+
'with #value2 with options', -> { UITableViewCell.value2('identifier', accessory: :disclosure, selection_style: :none, text: 'text', detailText: 'detail') },
|
166
|
+
'with #value2 with old options (:selection)', -> { UITableViewCell.value2('identifier', accessory: :disclosure, selection: :none, text: 'text', detailText: 'detail') },
|
164
167
|
'with #subtitle', -> { UITableViewCell.subtitle('identifier') },
|
165
|
-
'with #subtitle with options', -> { UITableViewCell.subtitle('identifier', accessory: :disclosure,
|
168
|
+
'with #subtitle with options', -> { UITableViewCell.subtitle('identifier', accessory: :disclosure, selection_style: :none, text: 'text', detailText: 'detail') },
|
169
|
+
'with #subtitle with old options (:selection)', -> { UITableViewCell.subtitle('identifier', accessory: :disclosure, selection: :none, text: 'text', detailText: 'detail') },
|
166
170
|
].each_slice(2) do |description, factory|
|
167
171
|
it "should work #{description}" do
|
168
172
|
error = factory.call
|
@@ -174,30 +178,30 @@ describe 'SugarCube Factories' do
|
|
174
178
|
describe UILabel do
|
175
179
|
|
176
180
|
describe 'new method' do
|
177
|
-
it 'should support UILabel.
|
178
|
-
label = UILabel.
|
181
|
+
it 'should support UILabel.label' do
|
182
|
+
label = UILabel.label
|
179
183
|
label.should.be.kind_of(UILabel)
|
180
184
|
end
|
181
|
-
it 'should support UILabel.
|
182
|
-
label = UILabel.
|
185
|
+
it 'should support UILabel.label(text)' do
|
186
|
+
label = UILabel.label('text')
|
183
187
|
label.should.be.kind_of(UILabel)
|
184
188
|
label.text.should == 'text'
|
185
189
|
end
|
186
|
-
it 'should support UILabel.
|
187
|
-
label = UILabel.
|
190
|
+
it 'should support UILabel.label(text, font)' do
|
191
|
+
label = UILabel.label('text', UIFont.fontWithName('Helvetica', size: 10))
|
188
192
|
label.should.be.kind_of(UILabel)
|
189
193
|
label.text.should == 'text'
|
190
194
|
label.font.familyName.should == 'Helvetica'
|
191
195
|
label.font.pointSize.should == 10
|
192
196
|
end
|
193
|
-
it 'should support UILabel.
|
194
|
-
label = UILabel.
|
197
|
+
it 'should support UILabel.label(text, font_name)' do
|
198
|
+
label = UILabel.label('text', 'Helvetica')
|
195
199
|
label.should.be.kind_of(UILabel)
|
196
200
|
label.text.should == 'text'
|
197
201
|
label.font.familyName.should == 'Helvetica'
|
198
202
|
end
|
199
|
-
it 'should support UILabel.
|
200
|
-
label = UILabel.
|
203
|
+
it 'should support UILabel.label(text, font_name, size)' do
|
204
|
+
label = UILabel.label('text', 'Helvetica', 10)
|
201
205
|
label.should.be.kind_of(UILabel)
|
202
206
|
label.text.should == 'text'
|
203
207
|
label.font.familyName.should == 'Helvetica'
|