ns-options 0.4.1 → 1.0.0.rc1

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.
Files changed (51) hide show
  1. data/.gitignore +3 -0
  2. data/Gemfile +2 -1
  3. data/LICENSE +1 -1
  4. data/README.md +187 -301
  5. data/Rakefile +1 -1
  6. data/lib/ns-options/assert_macros.rb +9 -12
  7. data/lib/ns-options/boolean.rb +2 -0
  8. data/lib/ns-options/namespace.rb +34 -134
  9. data/lib/ns-options/namespace_advisor.rb +35 -0
  10. data/lib/ns-options/namespace_data.rb +166 -0
  11. data/lib/ns-options/namespaces.rb +23 -12
  12. data/lib/ns-options/option.rb +50 -24
  13. data/lib/ns-options/options.rb +23 -49
  14. data/lib/ns-options/proxy.rb +40 -53
  15. data/lib/ns-options/proxy_method.rb +54 -0
  16. data/lib/ns-options/root_methods.rb +77 -0
  17. data/lib/ns-options/version.rb +1 -1
  18. data/lib/ns-options.rb +18 -8
  19. data/ns-options.gemspec +3 -4
  20. data/test/helper.rb +3 -10
  21. data/test/support/app.rb +3 -1
  22. data/test/support/proxy.rb +4 -0
  23. data/test/support/type_class_proxy.rb +29 -0
  24. data/test/support/user.rb +5 -5
  25. data/test/{integration/app_test.rb → system/app_tests.rb} +8 -6
  26. data/test/{integration/proxy_test.rb → system/proxy_tests.rb} +12 -0
  27. data/test/system/type_class_proxy_tests.rb +108 -0
  28. data/test/system/user_tests.rb +146 -0
  29. data/test/unit/{ns-options/boolean_test.rb → boolean_tests.rb} +5 -4
  30. data/test/unit/namespace_advisor_tests.rb +69 -0
  31. data/test/unit/namespace_data_tests.rb +336 -0
  32. data/test/unit/namespace_tests.rb +205 -0
  33. data/test/unit/namespaces_tests.rb +99 -0
  34. data/test/unit/{ns-options/option_test.rb → option_tests.rb} +155 -93
  35. data/test/unit/options_tests.rb +152 -0
  36. data/test/unit/proxy_method_tests.rb +87 -0
  37. data/test/unit/{ns-options/proxy_test.rb → proxy_tests.rb} +52 -0
  38. data/test/unit/root_methods_tests.rb +126 -0
  39. metadata +58 -63
  40. data/lib/ns-options/errors/invalid_name.rb +0 -15
  41. data/lib/ns-options/has_options.rb +0 -53
  42. data/lib/ns-options/helper/advisor.rb +0 -88
  43. data/lib/ns-options/helper.rb +0 -87
  44. data/test/integration/user_test.rb +0 -94
  45. data/test/unit/ns-options/has_options_test.rb +0 -90
  46. data/test/unit/ns-options/helper/advisor_test.rb +0 -148
  47. data/test/unit/ns-options/helper_test.rb +0 -56
  48. data/test/unit/ns-options/namespace_test.rb +0 -432
  49. data/test/unit/ns-options/namespaces_test.rb +0 -55
  50. data/test/unit/ns-options/options_test.rb +0 -221
  51. /data/test/unit/{ns-options/assert_macros_test.rb → assert_macros_tests.rb} +0 -0
@@ -1,432 +0,0 @@
1
- require 'assert'
2
-
3
- class NsOptions::Namespace
4
-
5
- class BaseTest < Assert::Context
6
- desc "NsOptions::Namespace"
7
- setup do
8
- @key = "something"
9
- @namespace = NsOptions::Namespace.new(@key)
10
- end
11
- subject{ @namespace }
12
-
13
- should have_accessors :metaclass, :options
14
- should have_instance_methods :option, :opt
15
- should have_instance_methods :namespace, :ns
16
- should have_instance_methods :required_set?, :valid?
17
- should have_instance_methods :define, :apply
18
- should have_instance_methods :to_hash, :each
19
-
20
- should "have set it's metaclass accessor" do
21
- assert subject.metaclass
22
- end
23
-
24
- should "have created a new options collection and set it's options accessor" do
25
- assert subject.options
26
- assert_kind_of NsOptions::Options, subject.options
27
- assert_equal @key, subject.options.key
28
- assert_nil subject.options.parent
29
- end
30
-
31
- should "contain its options key in its inspect output" do
32
- assert_included ":#{subject.options.key}", subject.inspect
33
- end
34
-
35
- end
36
-
37
- class OptionTest < BaseTest
38
- desc "option method"
39
- setup do
40
- @name = :something
41
- @type = String
42
- @rules = { :default => true }
43
- @namespace.option(@name, @type, @rules)
44
- end
45
- teardown do
46
- NsOptions::Helper.unstub(:advisor)
47
- end
48
- subject{ @namespace }
49
-
50
- should "have added the option to the namespace's options collection" do
51
- assert(option = subject.options[@name])
52
- assert_equal @name.to_s, option.name
53
- assert_equal @type, option.type_class
54
- assert_equal @rules, option.rules
55
- end
56
-
57
- should "check if the option name is ok" do
58
- advisor = NsOptions::Helper::Advisor.new(@namespace)
59
- NsOptions::Helper.expects(:advisor).with(@namespace).returns(advisor)
60
- advisor.expects(:is_this_option_ok?)
61
- assert_nothing_raised do
62
- @namespace.option(:amazing)
63
- end
64
- end
65
- end
66
-
67
- class OptionWithNoTypeTest < BaseTest
68
- desc "option method with no type specified"
69
- setup do
70
- @name = :something
71
- @namespace.option(@name)
72
- end
73
- subject{ @namespace }
74
-
75
- should "default the type to Object" do
76
- assert(option = subject.options[@name])
77
- assert_equal Object, option.type_class
78
- end
79
-
80
- end
81
-
82
- class OptionMethodsTest < OptionTest
83
- desc "defined methods"
84
-
85
- should have_instance_methods :something, :something=
86
-
87
- should "be writable through the defined writer" do
88
- assert_nothing_raised{ subject.something = "abc" }
89
- assert_equal "abc", subject.something
90
- end
91
-
92
- should "be writable through the reader with args" do
93
- assert_nothing_raised{ subject.something "123" }
94
- assert_equal "123", subject.something
95
- end
96
-
97
- end
98
-
99
- class NamespaceTest < BaseTest
100
- desc "namespace method"
101
- setup do
102
- @namespace.namespace(:something) do
103
- option :something_else
104
- end
105
- @namespace.namespace(:another, "special_key")
106
- end
107
- teardown do
108
- NsOptions::Helper.unstub(:advisor)
109
- end
110
- subject{ @namespace }
111
-
112
- should "have added a namespace to the namespace's options collection" do
113
- assert(namespace = subject.options.namespaces[:something])
114
- assert_equal "#{subject.options.key}:something", namespace.options.key
115
- assert_equal subject, namespace.options.parent
116
- assert namespace.options[:something_else]
117
- end
118
-
119
- should "allow passing a special key to the namespace" do
120
- assert(namespace = subject.options.namespaces[:another])
121
- assert_equal "#{subject.options.key}:special_key", namespace.options.key
122
- end
123
-
124
- should "check if the namespace name is ok" do
125
- advisor = NsOptions::Helper::Advisor.new(@namespace)
126
- NsOptions::Helper.expects(:advisor).with(@namespace).returns(advisor)
127
- advisor.expects(:is_this_sub_namespace_ok?)
128
- assert_nothing_raised do
129
- @namespace.namespace(:yet_another)
130
- end
131
- end
132
-
133
- end
134
-
135
- class NamespaceMethodsTest < NamespaceTest
136
- desc "defined methods"
137
-
138
- should have_instance_methods :something
139
-
140
- should "be return the namespace using the reader" do
141
- assert_equal subject.options.namespaces[:something], subject.something
142
- end
143
-
144
- should "define the namespace with the reader and a block" do
145
- subject.something do
146
- option :another
147
- end
148
- assert subject.something.options[:another]
149
- end
150
-
151
- end
152
-
153
- class DefineTest < BaseTest
154
- desc "define method"
155
-
156
- class BlockWithoutArityTest < BaseTest
157
- desc "with a block with no arity"
158
-
159
- should "instance eval the block in the scope of the namespace" do
160
- scope = nil
161
- subject.define do
162
- scope = self
163
- end
164
- assert_equal subject, scope
165
- end
166
- end
167
- class BlockWithArityTest < BaseTest
168
- desc "with a block with arity"
169
-
170
- should "yield the namespace to the block" do
171
- yielded = nil
172
- subject.define do |namespace|
173
- yielded = namespace
174
- end
175
- assert_equal subject, yielded
176
- end
177
- end
178
- class NoBlockTest < BaseTest
179
- desc "with no block"
180
-
181
- should "return the namespace" do
182
- assert_equal subject, subject.define
183
- end
184
- end
185
- end
186
-
187
- class MethodMissingTest < BaseTest
188
- desc "method missing"
189
- setup do
190
- @namespace = NsOptions::Namespace.new("strange")
191
- @namespace.options.add(:something)
192
- @namespace.options.set(:something, "amazing")
193
- end
194
-
195
- class ReaderForAKnownOptionTest < MethodMissingTest
196
- desc "as a reader for a known option"
197
- setup do
198
- @result = @namespace.something
199
- end
200
-
201
- should "have defined the option on the namespace" do
202
- defined_methods = subject.metaclass.public_instance_methods(false).map(&:to_sym)
203
- assert_includes :something, defined_methods
204
- assert_includes :something=, defined_methods
205
- assert_equal "amazing", @result
206
- end
207
- end
208
- class WriterForAKnownOptionTest < MethodMissingTest
209
- desc "as a reader for a known option"
210
- setup do
211
- @namespace.something = "even more amazing"
212
- end
213
-
214
- should "have defined the option on the namespace" do
215
- defined_methods = subject.metaclass.public_instance_methods(false).map(&:to_sym)
216
- assert_includes :something, defined_methods
217
- assert_includes :something=, defined_methods
218
- assert_equal "even more amazing", subject.something
219
- end
220
- end
221
- class DynamicWriterTest < MethodMissingTest
222
- desc "with a writer for an unknown option"
223
- setup do
224
- @namespace.something_not_defined = "you know it"
225
- @namespace.another_not_defined = true
226
- @namespace.even_more_not_defined = 12
227
- @namespace.just_one_more_not_defined = nil
228
- @namespace.proc_opt_not_defined = Proc.new { "imma proc!" }
229
- end
230
-
231
- should "have defined the accessors and added the option" do
232
- defined_methods = subject.metaclass.public_instance_methods(false).map(&:to_sym)
233
- assert subject.options[:something_not_defined]
234
- assert_includes :something_not_defined, defined_methods
235
- assert_includes :something_not_defined=, defined_methods
236
- assert_equal "you know it", subject.something_not_defined
237
- end
238
-
239
- should "use Object for the option's type class, no matter what the value is" do
240
- assert_equal Object, subject.options[:something_not_defined].type_class
241
- assert_equal Object, subject.options[:another_not_defined].type_class
242
- assert_equal Object, subject.options[:even_more_not_defined].type_class
243
- assert_equal Object, subject.options[:just_one_more_not_defined].type_class
244
- assert_equal Object, subject.options[:proc_opt_not_defined].type_class
245
- end
246
-
247
- should "return the Proc return val when an unknow option is set to a Proc" do
248
- assert_not_kind_of Proc, subject.options[:proc_opt_not_defined].type_class
249
- assert_equal "imma proc!", subject.proc_opt_not_defined
250
- end
251
-
252
- end
253
- end
254
-
255
- class RespondToTest < BaseTest
256
- desc "respond to"
257
- setup do
258
- @namespace.options.add(:something)
259
- end
260
-
261
- should "return true when the reader of an option is requested without the reader defined" do
262
- assert_not_includes :something, subject.class.public_instance_methods(false).map(&:to_sym)
263
- assert_not_includes :something, subject.metaclass.public_instance_methods(false).map(&:to_sym)
264
- assert_equal true, subject.respond_to?(:something)
265
- end
266
- end
267
-
268
- class WithAParentTest < BaseTest
269
- desc "with a parent"
270
- setup do
271
- @key = "options"
272
- @parent = @namespace
273
- @namespace = NsOptions::Namespace.new(@key, @parent)
274
- end
275
- subject{ @namespace }
276
-
277
- should "have set it's options accessor and stored it's parent on it" do
278
- assert subject.options
279
- assert_equal @parent, subject.options.parent
280
- end
281
- end
282
-
283
-
284
-
285
- class HandlingTests < BaseTest
286
- setup do
287
- @namespace.define do
288
- option :first
289
- option :second
290
- option :third
291
- namespace(:child_a) do
292
- option(:fourth)
293
- option(:fifth)
294
- namespace(:child_b) do
295
- option(:sixth)
296
- end
297
- end
298
- end
299
-
300
- @named_values = {
301
- :first => "1", :second => "2", :third => "3", :twenty_one => "21",
302
- :child_a => {
303
- :fourth => "4", :fifth => "5",
304
- :child_b => { :sixth => "6" }
305
- },
306
- :child_c => { :what => "?" }
307
- }
308
- end
309
-
310
- end
311
-
312
-
313
-
314
- class ApplyTest < HandlingTests
315
- desc "apply method"
316
- setup do
317
- @namespace.apply(@named_values)
318
- end
319
-
320
- should "have mass set all the defined options" do
321
- assert_equal @named_values[:first], subject.first
322
- assert_equal @named_values[:second], subject.second
323
- assert_equal @named_values[:third], subject.third
324
- assert_equal @named_values[:child_a][:fourth], subject.child_a.fourth
325
- assert_equal @named_values[:child_a][:fifth], subject.child_a.fifth
326
- assert_equal @named_values[:child_a][:child_b][:sixth], subject.child_a.child_b.sixth
327
- end
328
- should "have dynamically added options for the undefined keys" do
329
- assert_equal @named_values[:twenty_one], subject.twenty_one
330
- assert_equal @named_values[:child_c], subject.child_c
331
- end
332
-
333
- end
334
-
335
-
336
-
337
- class ToHashTests < HandlingTests
338
- desc "when to_hash"
339
- subject { @namespace.to_hash }
340
-
341
- should "return a Hash representation for the namespace" do
342
- assert_equal({
343
- :first => nil,
344
- :second => nil,
345
- :third => nil,
346
- :child_a => {
347
- :fourth => nil,
348
- :fifth => nil,
349
- :child_b => {
350
- :sixth => nil
351
- }
352
- }
353
- }, subject)
354
-
355
- @namespace.first = "first"
356
- assert_equal({
357
- :first => "first",
358
- :second => nil,
359
- :third => nil,
360
- :child_a => {
361
- :fourth => nil,
362
- :fifth => nil,
363
- :child_b => {
364
- :sixth => nil
365
- }
366
- }
367
- }, subject)
368
-
369
- @namespace.apply(@named_values)
370
- assert_equal @named_values, subject
371
- end
372
-
373
- should "contain its to_hash representation in its inspect output" do
374
- assert_included subject.inspect, @namespace.inspect
375
- end
376
-
377
- end
378
-
379
-
380
- class EachTests < HandlingTests
381
- desc "iterated with the each method"
382
- setup do
383
- @namespace.apply(@named_values)
384
- @exp = "".tap do |exp|
385
- @namespace.to_hash.each do |k,v|
386
- exp << "#{k}=#{v};"
387
- end
388
- end
389
- @act = "".tap do |exp|
390
- @namespace.each do |k,v|
391
- exp << "#{k}=#{v};"
392
- end
393
- end
394
- end
395
-
396
- should "yield k/v pairs by iterating over the #to_hash" do
397
- assert_equal @exp, @act
398
- end
399
-
400
- end
401
-
402
-
403
- class EqualityTests < HandlingTests
404
- desc "when compared for equality"
405
- setup do
406
- @namespace.apply(@named_values)
407
- end
408
-
409
- should "be equal to another namespace with the same named values" do
410
- other_ns = NsOptions::Namespace.new('other_something')
411
- other_ns.apply(@named_values)
412
-
413
- assert_equal other_ns, @namespace
414
- end
415
-
416
- should "not be equal to another namespace with different values" do
417
- other_ns = NsOptions::Namespace.new('other_something')
418
- other_ns.apply({:other => 'data'})
419
-
420
- assert_not_equal other_ns, @namespace
421
- end
422
-
423
- should "not be equal to other things" do
424
- assert_not_equal 1, @namespace
425
- assert_not_equal @named_value, @namespace
426
- end
427
-
428
- end
429
-
430
-
431
-
432
- end
@@ -1,55 +0,0 @@
1
- require 'assert'
2
-
3
- class NsOptions::Namespaces
4
-
5
- class BaseTest < Assert::Context
6
- desc "NsOptions::Namespaces"
7
- setup do
8
- @namespaces = NsOptions::Namespaces.new
9
- end
10
- subject{ @namespaces }
11
-
12
- should have_instance_methods :add, :get
13
-
14
- should "be a kind of a hash" do
15
- assert_kind_of Hash, subject
16
- end
17
- should "only use symbols for keys" do
18
- subject["string_key"] = true
19
- subject[:symbol_key] = true
20
-
21
- assert_includes :string_key, subject.keys
22
- assert_includes :symbol_key, subject.keys
23
- assert_not_includes "string_key", subject.keys
24
- end
25
- end
26
-
27
- class AddTest < BaseTest
28
- desc "add method"
29
- setup do
30
- @parent = NsOptions::Namespace.new(:parent)
31
- @namespaces.add(:a_name, "a-key", @parent) do
32
- option :an_option
33
- end
34
- end
35
- subject{ @namespaces }
36
-
37
- should "have created a new namespace and added it to itself" do
38
- assert(namespace = subject[:a_name])
39
- assert_kind_of NsOptions::Namespace, namespace
40
- assert_equal "a-key", namespace.options.key
41
- assert_equal @parent, namespace.options.parent
42
- assert namespace.options[:an_option]
43
- end
44
- end
45
-
46
- class GetTest < AddTest
47
- desc "get method"
48
-
49
- should "return the namespace matching the name" do
50
- assert(namespace = subject.get("a_name"))
51
- assert_equal subject[:a_name], namespace
52
- end
53
- end
54
-
55
- end
@@ -1,221 +0,0 @@
1
- require 'assert'
2
-
3
- class NsOptions::Options
4
-
5
- class BaseTest < Assert::Context
6
- desc "NsOptions::Options"
7
- setup do
8
- @options = NsOptions::Options.new(:something)
9
- end
10
- subject{ @options }
11
-
12
- should have_accessors :key, :parent, :namespaces
13
- should have_instance_method :add, :del, :remove, :get, :set, :fetch, :is_defined?,
14
- :add_namespace, :get_namespace, :build_from
15
-
16
- should "be a kind of Hash" do
17
- assert_kind_of Hash, subject
18
- end
19
- should "only use symbols for keys" do
20
- subject["string_key"] = true
21
- subject[:symbol_key] = true
22
-
23
- assert_includes :string_key, subject.keys
24
- assert_includes :symbol_key, subject.keys
25
- assert_not_includes "string_key", subject.keys
26
- end
27
- should "have set the key" do
28
- assert_equal "something", subject.key
29
- end
30
- should "have set the parent to nil" do
31
- assert_nil subject.parent
32
- end
33
- should "return a kind of NsOption::Namespaces with a call to #children" do
34
- assert_kind_of NsOptions::Namespaces, subject.namespaces
35
- end
36
- end
37
-
38
- class AddTest < BaseTest
39
- desc "add method"
40
- setup do
41
- @options.add(:my_string)
42
- @options.add(:my_integer, Integer)
43
- @options.add(:my_float, Float, { :default => 1.0 })
44
- end
45
- subject{ @options }
46
-
47
- should "have added a object option on itself when adding :my_string" do
48
- assert(option = subject[:my_string])
49
- assert_equal Object, option.type_class
50
- assert_equal({ :args => [] }, option.rules)
51
- end
52
- should "have added an integer option on itself when adding :my_integer" do
53
- assert(option = subject[:my_integer])
54
- assert_equal Integer, option.type_class
55
- assert_equal({ :args => [] }, option.rules)
56
- end
57
- should "have added a float option on itself when adding :my_float" do
58
- assert(option = subject[:my_float])
59
- assert_equal Float, option.type_class
60
- assert_equal(1.0, option.rules[:default])
61
- end
62
- end
63
-
64
- class DelTest < BaseTest
65
- desc "add method"
66
- setup do
67
- @options.add(:my_string)
68
- @options.del(:my_string)
69
- end
70
- subject{ @options }
71
-
72
- should "remove the option definition from the collection" do
73
- assert_nil subject[:my_string]
74
- end
75
- end
76
-
77
- class GetTest < BaseTest
78
- desc "get method"
79
- setup do
80
- option = @options.add(:my_string)
81
- option.value = @value = "something"
82
- @result = @options.get(:my_string)
83
- end
84
- subject{ @result }
85
-
86
- should "have returned the option's value" do
87
- assert_equal @value, subject
88
- end
89
- end
90
-
91
- class SetTest < BaseTest
92
- desc "set method"
93
- setup do
94
- option = @options.add(:my_string)
95
- @options.set(:my_string, "something")
96
- end
97
- subject{ @options }
98
-
99
- should "have set the option's value" do
100
- assert_equal "something", subject.get(:my_string)
101
- end
102
- end
103
-
104
- class IsDefinedTest < BaseTest
105
- desc "fetch method"
106
- setup do
107
- option = @options.add(:my_string)
108
- end
109
- subject{ @options }
110
-
111
- should "return true for a defined option" do
112
- assert_equal true, subject.is_defined?(:my_string)
113
- end
114
- should "return false for an undefined option" do
115
- assert_equal false, subject.is_defined?(:undefined)
116
- end
117
- end
118
-
119
- class RequiredSetTest < BaseTest
120
- desc "required_set? method"
121
- setup do
122
- @options.add(:first, String, { :require => true })
123
- @options.add(:second, String, { :required => true })
124
- @options.add(:third, String)
125
- end
126
-
127
- should "return true when all required options are set" do
128
- @options.set(:first, "first")
129
- @options.set(:second, "second")
130
- assert_equal true, subject.required_set?
131
- end
132
- should "return false if one required option is not set" do
133
- @options.set(:first, "first")
134
- @options.set(:third, "third")
135
- assert_equal false, subject.required_set?
136
- end
137
- should "not change because of options that aren't required" do
138
- @options.set(:first, "first")
139
- @options.set(:second, "second")
140
- @options.set(:third, "third")
141
- assert_equal true, subject.required_set?
142
- @options.set(:third, nil)
143
- assert_equal true, subject.required_set?
144
- end
145
- end
146
-
147
- class WithNamespaceTest < BaseTest
148
- setup do
149
- @namespace = @options.add_namespace(:something, :something)
150
- end
151
- end
152
-
153
- class AddNamespaceTest < WithNamespaceTest
154
- desc "add_namespace method"
155
- subject{ @options }
156
-
157
- should "create a new namespace and add it to the options namespaces collection" do
158
- assert_instance_of NsOptions::Namespace, @namespace
159
- assert_equal @namespace, subject.namespaces[:something]
160
- end
161
- end
162
-
163
- class GetNamespaceTest < WithNamespaceTest
164
- desc "get_namespace method"
165
- setup do
166
- @got_namespace = @options.get_namespace(:something)
167
- end
168
- subject{ @got_namespace }
169
-
170
- should "allow retrieving a namespace without having to access the namespaces directly" do
171
- assert_equal @namespace, subject
172
- end
173
- end
174
-
175
- class IsNamespaceDefinedTest < WithNamespaceTest
176
- desc "is_namespace_defined? method"
177
- setup do
178
- @has_something = @options.is_namespace_defined?(:something)
179
- @has_nothing = @options.is_namespace_defined?(:nothing)
180
- end
181
-
182
- should "return a boolean of whether or not the namespace is defined" do
183
- assert_equal true, @has_something
184
- assert_equal false, @has_nothing
185
- end
186
- end
187
-
188
- class BuildFromTest < BaseTest
189
- desc "build_from method"
190
- setup do
191
- @namespace = NsOptions::Namespace.new("something")
192
- @from = NsOptions::Options.new(:something)
193
- @from.add(:root)
194
- @from.add_namespace(:else) do
195
- option :stage
196
- end
197
- @options = @namespace.options
198
- @options.build_from(@from, @namespace)
199
- end
200
- subject{ @options }
201
-
202
- should "have copied the options" do
203
- @from.each do |key, from_option|
204
- option = subject[key]
205
- assert_equal from_option.name, option.name
206
- assert_equal from_option.type_class, option.type_class
207
- assert_equal from_option.rules, option.rules
208
- assert_not_same from_option, option
209
- end
210
- end
211
- should "have copied the namespaces" do
212
- @from.namespaces.each do |name, from_namespace|
213
- namespace = subject.get_namespace(name)
214
- assert_equal from_namespace.options.key, namespace.options.key
215
- assert_equal from_namespace.options.parent, namespace.options.parent
216
- assert_not_same from_namespace, namespace
217
- end
218
- end
219
- end
220
-
221
- end