under-os 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -0
- data/Gemfile.lock +25 -2
- data/README.md +1 -1
- data/Rakefile +2 -4
- data/lib/under-os.rb +3 -8
- data/under-os.gemspec +6 -2
- metadata +47 -191
- data/lib/assets/fontawesome-webfont.ttf +0 -0
- data/lib/assets/under-os.css +0 -115
- data/lib/under_os.rb +0 -41
- data/lib/under_os/app.rb +0 -33
- data/lib/under_os/color.rb +0 -184
- data/lib/under_os/config.rb +0 -33
- data/lib/under_os/core/array.rb +0 -5
- data/lib/under_os/core/hash.rb +0 -10
- data/lib/under_os/core/json.rb +0 -19
- data/lib/under_os/core/kernel.rb +0 -16
- data/lib/under_os/core/numeric.rb +0 -23
- data/lib/under_os/core/object.rb +0 -9
- data/lib/under_os/core/string.rb +0 -80
- data/lib/under_os/delegate.rb +0 -10
- data/lib/under_os/events.rb +0 -85
- data/lib/under_os/file.rb +0 -110
- data/lib/under_os/history.rb +0 -53
- data/lib/under_os/http.rb +0 -31
- data/lib/under_os/http/cookies.rb +0 -30
- data/lib/under_os/http/receiver.rb +0 -44
- data/lib/under_os/http/request.rb +0 -106
- data/lib/under_os/http/response.rb +0 -28
- data/lib/under_os/http/session.rb +0 -49
- data/lib/under_os/page.rb +0 -169
- data/lib/under_os/page/builder.rb +0 -96
- data/lib/under_os/page/layout.rb +0 -43
- data/lib/under_os/page/matcher.rb +0 -128
- data/lib/under_os/page/stylesheet.rb +0 -67
- data/lib/under_os/parser.rb +0 -24
- data/lib/under_os/parser/css.rb +0 -37
- data/lib/under_os/parser/html.rb +0 -97
- data/lib/under_os/point.rb +0 -47
- data/lib/under_os/screen.rb +0 -9
- data/lib/under_os/timer.rb +0 -65
- data/lib/under_os/ui.rb +0 -3
- data/lib/under_os/ui/alert.rb +0 -52
- data/lib/under_os/ui/button.rb +0 -42
- data/lib/under_os/ui/collection.rb +0 -65
- data/lib/under_os/ui/collection/cell.rb +0 -21
- data/lib/under_os/ui/collection/delegate.rb +0 -70
- data/lib/under_os/ui/collection/item.rb +0 -32
- data/lib/under_os/ui/collection/layout.rb +0 -43
- data/lib/under_os/ui/collection/styles.rb +0 -15
- data/lib/under_os/ui/div.rb +0 -3
- data/lib/under_os/ui/form.rb +0 -60
- data/lib/under_os/ui/icon.rb +0 -61
- data/lib/under_os/ui/icon/awesome.rb +0 -376
- data/lib/under_os/ui/icon/engine.rb +0 -10
- data/lib/under_os/ui/image.rb +0 -31
- data/lib/under_os/ui/input.rb +0 -140
- data/lib/under_os/ui/label.rb +0 -21
- data/lib/under_os/ui/locker.rb +0 -42
- data/lib/under_os/ui/navbar.rb +0 -123
- data/lib/under_os/ui/progress.rb +0 -17
- data/lib/under_os/ui/scroll.rb +0 -41
- data/lib/under_os/ui/select.rb +0 -95
- data/lib/under_os/ui/sidebar.rb +0 -45
- data/lib/under_os/ui/slider.rb +0 -37
- data/lib/under_os/ui/spinner.rb +0 -23
- data/lib/under_os/ui/style.rb +0 -21
- data/lib/under_os/ui/style/fonts.rb +0 -54
- data/lib/under_os/ui/style/margins.rb +0 -164
- data/lib/under_os/ui/style/outlining.rb +0 -170
- data/lib/under_os/ui/style/positioning.rb +0 -169
- data/lib/under_os/ui/switch.rb +0 -26
- data/lib/under_os/ui/textarea.rb +0 -19
- data/lib/under_os/ui/utils/animation.rb +0 -99
- data/lib/under_os/ui/utils/commons.rb +0 -70
- data/lib/under_os/ui/utils/dimensions.rb +0 -37
- data/lib/under_os/ui/utils/events.rb +0 -170
- data/lib/under_os/ui/utils/manipulation.rb +0 -44
- data/lib/under_os/ui/utils/position.rb +0 -21
- data/lib/under_os/ui/utils/size.rb +0 -21
- data/lib/under_os/ui/utils/styles.rb +0 -89
- data/lib/under_os/ui/utils/traversing.rb +0 -44
- data/lib/under_os/ui/utils/wrap.rb +0 -77
- data/lib/under_os/ui/view.rb +0 -31
- data/resources/test.png +0 -0
- data/spec/assets/app.css +0 -13
- data/spec/assets/test.css +0 -7
- data/spec/assets/test.html +0 -3
- data/spec/assets/test_page.rb +0 -2
- data/spec/lib/core/hash_spec.rb +0 -19
- data/spec/lib/core/json_spec.rb +0 -32
- data/spec/lib/core/numeric_spec.rb +0 -37
- data/spec/lib/core/string_spec.rb +0 -121
- data/spec/lib/under_os/color_spec.rb +0 -133
- data/spec/lib/under_os/events_spec.rb +0 -71
- data/spec/lib/under_os/file_spec.rb +0 -98
- data/spec/lib/under_os/http/cookies_spec.rb +0 -13
- data/spec/lib/under_os/http/request_spec.rb +0 -44
- data/spec/lib/under_os/http_spec.rb +0 -20
- data/spec/lib/under_os/page/builder_spec.rb +0 -128
- data/spec/lib/under_os/page/layout_spec.rb +0 -18
- data/spec/lib/under_os/page/matcher_spec.rb +0 -260
- data/spec/lib/under_os/page/stylesheet_spec.rb +0 -83
- data/spec/lib/under_os/page_spec.rb +0 -5
- data/spec/lib/under_os/parser/css_spec.rb +0 -77
- data/spec/lib/under_os/parser/html_spec.rb +0 -152
- data/spec/lib/under_os/parser_spec.rb +0 -16
- data/spec/lib/under_os/point_spec.rb +0 -54
- data/spec/lib/under_os/screen_spec.rb +0 -11
- data/spec/lib/under_os/timer_spec.rb +0 -93
- data/spec/lib/under_os/ui/button_spec.rb +0 -50
- data/spec/lib/under_os/ui/collection_spec.rb +0 -19
- data/spec/lib/under_os/ui/div_spec.rb +0 -24
- data/spec/lib/under_os/ui/form_spec.rb +0 -156
- data/spec/lib/under_os/ui/icon_spec.rb +0 -57
- data/spec/lib/under_os/ui/image_spec.rb +0 -39
- data/spec/lib/under_os/ui/input_spec.rb +0 -109
- data/spec/lib/under_os/ui/label_spec.rb +0 -22
- data/spec/lib/under_os/ui/locker_spec.rb +0 -31
- data/spec/lib/under_os/ui/progress_spec.rb +0 -31
- data/spec/lib/under_os/ui/scroll_spec.rb +0 -40
- data/spec/lib/under_os/ui/select_spec.rb +0 -135
- data/spec/lib/under_os/ui/sidebar_spec.rb +0 -35
- data/spec/lib/under_os/ui/slider_spec.rb +0 -69
- data/spec/lib/under_os/ui/spinner_spec.rb +0 -57
- data/spec/lib/under_os/ui/style/fonts_spec.rb +0 -73
- data/spec/lib/under_os/ui/style/margins_spec.rb +0 -106
- data/spec/lib/under_os/ui/style/outlining_spec.rb +0 -101
- data/spec/lib/under_os/ui/style/positioning_spec.rb +0 -69
- data/spec/lib/under_os/ui/style_spec.rb +0 -19
- data/spec/lib/under_os/ui/switch_spec.rb +0 -60
- data/spec/lib/under_os/ui/textarea_spec.rb +0 -34
- data/spec/lib/under_os/ui/utils/commons_spec.rb +0 -81
- data/spec/lib/under_os/ui/utils/events_spec.rb +0 -87
- data/spec/lib/under_os/ui/utils/manipulation_spec.rb +0 -130
- data/spec/lib/under_os/ui/utils/styles_spec.rb +0 -140
- data/spec/lib/under_os/ui/utils/traversing_spec.rb +0 -124
- data/spec/lib/under_os/ui/utils/wrap_spec.rb +0 -69
- data/spec/lib/under_os/ui/view_spec.rb +0 -39
@@ -1,31 +0,0 @@
|
|
1
|
-
describe UnderOs::UI::Progress do
|
2
|
-
before do
|
3
|
-
@progress = UnderOs::UI::Progress.new
|
4
|
-
end
|
5
|
-
|
6
|
-
describe '#initialize' do
|
7
|
-
it "should build a spinner" do
|
8
|
-
@progress.class.should == UnderOs::UI::Progress
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should wrap the UIProgressView" do
|
12
|
-
@progress._.class.should == UIProgressView
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should have the correct tag name" do
|
16
|
-
@progress.tagName.should == 'PROGRESS'
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should accept the 'value' option" do
|
20
|
-
progress = UnderOs::UI::Progress.new(value: 0.4)
|
21
|
-
progress.value.should == 0.4
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe '#value' do
|
26
|
-
it "should assign values correctly" do
|
27
|
-
@progress.value = 0.6
|
28
|
-
@progress._.progress.should == 0.6
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
describe UnderOs::UI::Scroll do
|
2
|
-
before do
|
3
|
-
@scroll = UnderOs::UI::Scroll.new
|
4
|
-
end
|
5
|
-
|
6
|
-
describe '#initialize' do
|
7
|
-
it 'should build an UI:Scroll object' do
|
8
|
-
@scroll.class.should == UnderOs::UI::Scroll
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should wrap an UIScrollView instance" do
|
12
|
-
@scroll._.class.should == UIScrollView
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should have the SCROLL tag" do
|
16
|
-
@scroll.tagName.should == 'SCROLL'
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should accept the 'paging' option" do
|
20
|
-
scroll = UnderOs::UI::Scroll.new(paging: true)
|
21
|
-
scroll.paging.should == true
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe '#paging' do
|
26
|
-
it "should return 'false' by default" do
|
27
|
-
@scroll.paging.should == false
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should to switch it on" do
|
31
|
-
@scroll.paging = true
|
32
|
-
@scroll.paging.should == true
|
33
|
-
end
|
34
|
-
|
35
|
-
it "should fallback to false" do
|
36
|
-
@scroll.paging = 'weird stuff'
|
37
|
-
@scroll.paging.should == false
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,135 +0,0 @@
|
|
1
|
-
describe UnderOs::UI::Select do
|
2
|
-
before do
|
3
|
-
@select = UnderOs::UI::Select.new
|
4
|
-
end
|
5
|
-
|
6
|
-
it "inherits fromthe UnderOs::UI::Input" do
|
7
|
-
(UnderOs::UI::Select < UnderOs::UI::Input).should == true
|
8
|
-
end
|
9
|
-
|
10
|
-
describe '#initialize' do
|
11
|
-
it "should make select instances" do
|
12
|
-
@select.class.should == UnderOs::UI::Select
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should wrap UIPickerView" do
|
16
|
-
@select._.class.should == UIPickerView
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should have tag SELECT" do
|
20
|
-
@select.tagName.should == 'SELECT'
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should accept 'options' option" do
|
24
|
-
select = UnderOs::UI::Select.new(options: {
|
25
|
-
'1' => 'One', '2' => 'Two', '3' => 'Three'
|
26
|
-
})
|
27
|
-
|
28
|
-
select.options.should == {
|
29
|
-
'1' => 'One', '2' => 'Two', '3' => 'Three'
|
30
|
-
}
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should accept 'value' option" do
|
34
|
-
select = UnderOs::UI::Select.new(value: 1)
|
35
|
-
select.value.should == '1'
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
describe '#optgroups' do
|
40
|
-
it "should return an empty list by default" do
|
41
|
-
@select.optgroups.should == [{}]
|
42
|
-
end
|
43
|
-
|
44
|
-
it "should allow to assign groups" do
|
45
|
-
@select.optgroups = [
|
46
|
-
{'1' => 'One'}, {'2' => 'Two'}, {'3' => 'Three'}
|
47
|
-
]
|
48
|
-
|
49
|
-
@select.optgroups.should == [
|
50
|
-
{'1' => 'One'}, {'2' => 'Two'}, {'3' => 'Three'}
|
51
|
-
]
|
52
|
-
end
|
53
|
-
|
54
|
-
it "should convert keys to strings and skip nils" do
|
55
|
-
@select.optgroups = [{
|
56
|
-
nil => 'One', :'2' => 'Two', :'3' => nil
|
57
|
-
}]
|
58
|
-
|
59
|
-
@select.optgroups.should == [{'2' => 'Two'}]
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
describe '#options' do
|
64
|
-
it "should return an empty hash by default" do
|
65
|
-
@select.options.should == {}
|
66
|
-
end
|
67
|
-
|
68
|
-
it "should allow to set new options" do
|
69
|
-
@select.options = {
|
70
|
-
'1' => 'One', '2' => 'Two', '3' => 'Three'
|
71
|
-
}
|
72
|
-
|
73
|
-
@select.options.should == {
|
74
|
-
'1' => 'One', '2' => 'Two', '3' => 'Three'
|
75
|
-
}
|
76
|
-
end
|
77
|
-
|
78
|
-
it "should overwrite the optgroups" do
|
79
|
-
@select.options = {
|
80
|
-
'1' => 'One', '2' => 'Two', '3' => 'Three'
|
81
|
-
}
|
82
|
-
|
83
|
-
@select.optgroups.should == [{
|
84
|
-
'1' => 'One', '2' => 'Two', '3' => 'Three'
|
85
|
-
}]
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
describe '#value' do
|
90
|
-
it "should return nil when nothing was set" do
|
91
|
-
@select.value.should == nil
|
92
|
-
end
|
93
|
-
|
94
|
-
it "should return an empty list if several optgroups were set" do
|
95
|
-
@select.optgroups = [
|
96
|
-
{'1' => 'One'}, {'2' => 'Two'}, {'3' => 'Three'}
|
97
|
-
]
|
98
|
-
|
99
|
-
@select.value.should == []
|
100
|
-
end
|
101
|
-
|
102
|
-
it "should allow to set values for single selects" do
|
103
|
-
@select.value = 'one'
|
104
|
-
@select.value.should == 'one'
|
105
|
-
end
|
106
|
-
|
107
|
-
it "should allow to set values for multi-selects" do
|
108
|
-
@select.optgroups = [{'1' => 'One'}, {'2' => 'Two'}]
|
109
|
-
@select.value = ['1', '2']
|
110
|
-
@select.value.should == ['1', '2']
|
111
|
-
end
|
112
|
-
|
113
|
-
it "should convert all values to strings" do
|
114
|
-
@select.value = 1
|
115
|
-
@select.value.should == '1'
|
116
|
-
end
|
117
|
-
|
118
|
-
it "should emit the 'change' event if value was changed" do
|
119
|
-
@changed = false
|
120
|
-
@select.on(:change) { @changed = true }
|
121
|
-
@select.value = 'new'
|
122
|
-
@changed.should == true
|
123
|
-
end
|
124
|
-
|
125
|
-
it "should not emit the 'change' event if the same value was assigned" do
|
126
|
-
@select.value = 'same'
|
127
|
-
|
128
|
-
@changed = false
|
129
|
-
@select.on(:change) { @changed = true }
|
130
|
-
@select.value = 'same'
|
131
|
-
|
132
|
-
@changed.should == false
|
133
|
-
end
|
134
|
-
end
|
135
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
describe UnderOs::UI::Sidebar do
|
2
|
-
before do
|
3
|
-
@sidebar = UnderOs::UI::Sidebar.new
|
4
|
-
end
|
5
|
-
|
6
|
-
describe '#initialize' do
|
7
|
-
it "should build sidebars" do
|
8
|
-
@sidebar.class.should == UnderOs::UI::Sidebar
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should wrap up a normal UIView" do
|
12
|
-
@sidebar._.class.should == UIView
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should have the 'SIDEBAR' tag" do
|
16
|
-
@sidebar.tagName.should == "SIDEBAR"
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should accept the 'location' option" do
|
20
|
-
sidebar = UnderOs::UI::Sidebar.new(location: :left)
|
21
|
-
sidebar.location.should == :left
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe '#location' do
|
26
|
-
it "should return :bottom by default" do
|
27
|
-
@sidebar.location.should == :bottom
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should accept other values" do
|
31
|
-
@sidebar.location = 'top'
|
32
|
-
@sidebar.location.should == :top
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
describe UnderOs::UI::Slider do
|
2
|
-
before do
|
3
|
-
@slider = UnderOs::UI::Slider.new
|
4
|
-
end
|
5
|
-
|
6
|
-
it "inherits fromthe UnderOs::UI::Input" do
|
7
|
-
(UnderOs::UI::Slider < UnderOs::UI::Input).should == true
|
8
|
-
end
|
9
|
-
|
10
|
-
describe '#initialize' do
|
11
|
-
it "should spawn new sliders" do
|
12
|
-
@slider.class.should == UnderOs::UI::Slider
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should wrap the UISlider class" do
|
16
|
-
@slider._.class.should == UISlider
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should assign correct tag name" do
|
20
|
-
@slider.tagName.should == 'SLIDER'
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should accept the 'value' option" do
|
24
|
-
slider = UnderOs::UI::Slider.new(value: 0.4)
|
25
|
-
slider.value.should == 0.4
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should accept the 'min' option" do
|
29
|
-
slider = UnderOs::UI::Slider.new(min: 4)
|
30
|
-
slider.min.should == 4
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should accept the 'max' option" do
|
34
|
-
slider = UnderOs::UI::Slider.new(max: 4)
|
35
|
-
slider.max.should == 4
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
describe '#value' do
|
40
|
-
it "should assign the value property correctly" do
|
41
|
-
@slider.value = 0.25
|
42
|
-
@slider._.value.should == 0.25
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe '#min' do
|
47
|
-
it "should assign the minimal value boundaries correctly" do
|
48
|
-
@slider.min = -10
|
49
|
-
@slider._.minimumValue.should == -10
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should return the minimum value as it is" do
|
53
|
-
@slider.min = -20
|
54
|
-
@slider.min.should == -20
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
describe '#max' do
|
59
|
-
it "should assign the maximal value boundaries correctly" do
|
60
|
-
@slider.max = -10
|
61
|
-
@slider._.maximumValue.should == -10
|
62
|
-
end
|
63
|
-
|
64
|
-
it "should return the maximum value as it is" do
|
65
|
-
@slider.max = -20
|
66
|
-
@slider.max.should == -20
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
describe UnderOs::UI::Spinner do
|
2
|
-
before do
|
3
|
-
@spinner = UnderOs::UI::Spinner.new
|
4
|
-
end
|
5
|
-
|
6
|
-
describe 'constructor' do
|
7
|
-
it "should build a spinner" do
|
8
|
-
@spinner.class.should == UnderOs::UI::Spinner
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should wrap the UIActivityIndicatorView" do
|
12
|
-
@spinner._.class.should == UIActivityIndicatorView
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should have the correct tag name" do
|
16
|
-
@spinner.tagName.should == 'SPINNER'
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should make it spin" do
|
20
|
-
@spinner.visible.should == true
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe '#show' do
|
25
|
-
# it "should start the spinner" do
|
26
|
-
# @spinner.show
|
27
|
-
# @spinner._.isAnimating.should == 1
|
28
|
-
# end
|
29
|
-
|
30
|
-
it "should return the spinner back" do
|
31
|
-
@spinner.should.be.same_as @spinner
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe '#hide' do
|
36
|
-
# it "should stop the spinner" do
|
37
|
-
# @spinner.hide
|
38
|
-
# @spinner._.isAnimating.should == 0
|
39
|
-
# end
|
40
|
-
|
41
|
-
it "should return the spinner instance back" do
|
42
|
-
@spinner.hide.should.be.same_as @spinner
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe '#hidden' do
|
47
|
-
# it "should return false when the spinner is active" do
|
48
|
-
# @spinner.show
|
49
|
-
# @spinner.hidden.should == false
|
50
|
-
# end
|
51
|
-
|
52
|
-
# it "should return true when the spinner is inactive" do
|
53
|
-
# @spinner.hide
|
54
|
-
# @spinner.hidden.should == true
|
55
|
-
# end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,73 +0,0 @@
|
|
1
|
-
describe UnderOs::UI::Style::Fonts do
|
2
|
-
before do
|
3
|
-
@view = UnderOs::UI::View.new
|
4
|
-
end
|
5
|
-
|
6
|
-
describe 'text-align' do
|
7
|
-
|
8
|
-
it "should not crash when called on unsupported elements" do
|
9
|
-
@view.style.textAlign = 'left'
|
10
|
-
true.should == true
|
11
|
-
end
|
12
|
-
|
13
|
-
describe 'with a label' do
|
14
|
-
before do
|
15
|
-
@view = UnderOs::UI::Label.new(text: "Hello")
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should allow to align the text to the left" do
|
19
|
-
@view.style.textAlign = 'left'
|
20
|
-
@view._.textAlignment.should == NSTextAlignmentLeft
|
21
|
-
@view.style.textAlign.should == 'left'
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should allow to align the text to the right" do
|
25
|
-
@view.style.textAlign = 'right'
|
26
|
-
@view._.textAlignment.should == NSTextAlignmentRight
|
27
|
-
@view.style.textAlign.should == 'right'
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should allow to align the text to the center" do
|
31
|
-
@view.style.textAlign = 'center'
|
32
|
-
@view._.textAlignment.should == NSTextAlignmentCenter
|
33
|
-
@view.style.textAlign.should == 'center'
|
34
|
-
end
|
35
|
-
|
36
|
-
# it "should allow to align the text to fill the size" do
|
37
|
-
# @view.style.textAlign = 'justify'
|
38
|
-
# @view._.textAlignment.should == NSTextAlignmentJustified
|
39
|
-
# @view.style.textAlign.should == 'justify'
|
40
|
-
# end
|
41
|
-
end
|
42
|
-
|
43
|
-
describe 'with a button' do
|
44
|
-
before do
|
45
|
-
@view = UnderOs::UI::Button.new(text: "Hello")
|
46
|
-
end
|
47
|
-
|
48
|
-
it "should allow to align the text to the left" do
|
49
|
-
@view.style.textAlign = 'left'
|
50
|
-
@view._.contentHorizontalAlignment.should == UIControlContentHorizontalAlignmentLeft
|
51
|
-
@view.style.textAlign.should == 'left'
|
52
|
-
end
|
53
|
-
|
54
|
-
it "should allow to align the text to the right" do
|
55
|
-
@view.style.textAlign = 'right'
|
56
|
-
@view._.contentHorizontalAlignment.should == UIControlContentHorizontalAlignmentRight
|
57
|
-
@view.style.textAlign.should == 'right'
|
58
|
-
end
|
59
|
-
|
60
|
-
it "should allow to align the text to the center" do
|
61
|
-
@view.style.textAlign = 'center'
|
62
|
-
@view._.contentHorizontalAlignment.should == UIControlContentHorizontalAlignmentCenter
|
63
|
-
@view.style.textAlign.should == 'center'
|
64
|
-
end
|
65
|
-
|
66
|
-
it "should allow to align the text to fill the size" do
|
67
|
-
@view.style.textAlign = 'justify'
|
68
|
-
@view._.contentHorizontalAlignment.should == UIControlContentHorizontalAlignmentFill
|
69
|
-
@view.style.textAlign.should == 'justify'
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|