-
Notifications
You must be signed in to change notification settings - Fork 14
/
flex_compiler_options_test.rb
213 lines (167 loc) · 7.21 KB
/
flex_compiler_options_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
require 'test_helper'
class FlexCompilerOptionsTest < Test::Unit::TestCase
include Sprout::TestHelper
# formal tests for a variety of Flex compiler options and how they should appear on the CLI based on true/false settings
context "A Flex compiler's options" do
setup do
@mxmlc = FlashSDK::MXMLC.new
end
teardown do
end
# -as3
should "default to as3=true" do
assert_equal true, @mxmlc.as3
end
should "not include a -as3 flag if :as3 is set to true" do
@mxmlc.as3 = true
assert_no_match /-as3/, @mxmlc.to_shell
end
should "include -as3=false flag if :as3 is set to false" do
@mxmlc.as3 = false
assert_equal '-as3=false', @mxmlc.to_shell
end
# -benchmark
should "default to benchmark=true" do
assert_equal true, @mxmlc.benchmark
end
should "not include a -benchmark flag if :benchmark is set to true" do
@mxmlc.benchmark = true
assert_no_match /-benchmark/, @mxmlc.to_shell
end
should "include -benchmark=false flag if :benchmark is set to false" do
@mxmlc.benchmark = false
assert_equal '-benchmark=false', @mxmlc.to_shell
end
# -debug
should "default to debug=false" do
assert_equal false, @mxmlc.debug
end
should "not include a -debug flag if :debug is set to false" do
assert_no_match /-debug/, @mxmlc.to_shell
end
should "include -debug flag if :debug is set to true" do
@mxmlc.debug = true
assert_equal '-debug', @mxmlc.to_shell
end
# -use-network
should "default to use_network=false" do
assert_equal true, @mxmlc.use_network
end
should "not include a -use-network flag if :use_network is set to true" do
@mxmlc.use_network = true
assert_no_match /-use-network/, @mxmlc.to_shell
end
should "include -use-network=false flag if :use_network is set to false" do
@mxmlc.use_network = false
assert_equal '-use-network=false', @mxmlc.to_shell
end
# -optimize
should "default to optimize=true" do
assert_equal true, @mxmlc.optimize
end
should "not include a -optimize flag if :optimize is set to true" do
@mxmlc.optimize = true
assert_no_match /-optimize/, @mxmlc.to_shell
end
should "include -optimize=false flag if :optimize is set to false" do
@mxmlc.optimize = false
assert_equal '-optimize=false', @mxmlc.to_shell
end
# -show-actionscript-warnings
should "default to show-actionscript-warnings=true" do
assert_equal true, @mxmlc.show_actionscript_warnings
end
should "not include a -show-actionscript-warnings flag if :show-actionscript-warnings is set to true" do
@mxmlc.show_actionscript_warnings = true
assert_no_match /-show-actionscript-warnings/, @mxmlc.to_shell
end
should "include -show-actionscript-warnings=false flag if :show-actionscript-warnings is set to false" do
@mxmlc.show_actionscript_warnings = false
assert_equal '-show-actionscript-warnings=false', @mxmlc.to_shell
end
# -show-binding-warnings
should "default to show-binding-warnings=true" do
assert_equal true, @mxmlc.show_binding_warnings
end
should "not include a -show-binding-warnings flag if :show-binding-warnings is set to true" do
@mxmlc.show_binding_warnings = true
assert_no_match /-show-binding-warnings/, @mxmlc.to_shell
end
should "include -show-binding-warnings=false flag if :show-binding-warnings is set to false" do
@mxmlc.show_binding_warnings = false
assert_equal '-show-binding-warnings=false', @mxmlc.to_shell
end
# -show-shadowed-device-font-warnings
should "default to show-shadowed-device-font-warnings=true" do
assert_equal true, @mxmlc.show_shadowed_device_font_warnings
end
should "not include a -show-shadowed-device-font-warnings flag if :show-shadowed-device-font-warnings is set to true" do
@mxmlc.show_shadowed_device_font_warnings = true
assert_no_match /-show-shadowed-device-font-warnings/, @mxmlc.to_shell
end
should "include -show-shadowed-device-font-warnings=false flag if :show-shadowed-device-font-warnings is set to false" do
@mxmlc.show_shadowed_device_font_warnings = false
assert_equal '-show-shadowed-device-font-warnings=false', @mxmlc.to_shell
end
# -show-unused-type-selector-warnings
should "default to show-unused-type-selector-warnings=true" do
assert_equal true, @mxmlc.show_unused_type_selector_warnings
end
should "not include a -show-unused-type-selector-warnings flag if :show-unused-type-selector-warnings is set to true" do
@mxmlc.show_unused_type_selector_warnings = true
assert_no_match /-show-unused-type-selector-warnings/, @mxmlc.to_shell
end
should "include -show-unused-type-selector-warnings=false flag if :show-unused-type-selector-warnings is set to false" do
@mxmlc.show_unused_type_selector_warnings = false
assert_equal '-show-unused-type-selector-warnings=false', @mxmlc.to_shell
end
# -static-link-runtime-shared-libraries
should "default to static-link-runtime-shared-libraries=false" do
assert_equal false, @mxmlc.static_link_runtime_shared_libraries
end
should "include a -static-link-runtime-shared-libraries=true flag if :static-link-runtime-shared-libraries is set to true" do
@mxmlc.static_link_runtime_shared_libraries = true
assert_equal '-static-link-runtime-shared-libraries=true', @mxmlc.to_shell
end
should "not include -static-link-runtime-shared-libraries=false flag if :static-link-runtime-shared-libraries is set to false" do
@mxmlc.static_link_runtime_shared_libraries = false
assert_no_match /-static-link-runtime-shared-libraries/, @mxmlc.to_shell
end
# -strict
should "default to strict=true" do
assert_equal true, @mxmlc.strict
end
should "not include a -strict flag if :strict is set to true" do
@mxmlc.strict = true
assert_no_match /-strict/, @mxmlc.to_shell
end
should "include -strict=false flag if :strict is set to false" do
@mxmlc.strict = false
assert_equal '-strict=false', @mxmlc.to_shell
end
# -use-resource-bundle-metadata
should "default to use-resource-bundle-metadata=true" do
assert_equal true, @mxmlc.use_resource_bundle_metadata
end
should "not include a -use-resource-bundle-metadata flag if :use-resource-bundle-metadata is set to true" do
@mxmlc.use_resource_bundle_metadata = true
assert_no_match /-use-resource-bundle-metadata/, @mxmlc.to_shell
end
should "include -use-resource-bundle-metadata=false flag if :use-resource-bundle-metadata is set to false" do
@mxmlc.use_resource_bundle_metadata = false
assert_equal '-use-resource-bundle-metadata=false', @mxmlc.to_shell
end
# -warnings
should "default to warnings=true" do
assert_equal true, @mxmlc.warnings
end
should "not include a -warnings flag if :warnings is set to true" do
@mxmlc.warnings = true
assert_no_match /-warnings/, @mxmlc.to_shell
end
should "include -warnings=false flag if :warnings is set to false" do
@mxmlc.warnings = false
assert_equal '-warnings=false', @mxmlc.to_shell
end
end
end