mangdown 0.20.8 → 0.21.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,59 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Mangdown
4
- class PropertiesTest < Minitest::Test
5
- class SomeObject
6
- include Properties
7
-
8
- properties :property_a, :property_b
9
- end
10
-
11
- def setup
12
- @object = SomeObject.new
13
- end
14
-
15
- def test_properties
16
- assert_equal({ property_a: nil, property_b: nil }, @object.properties)
17
- end
18
-
19
- def test_getters_and_setters
20
- @object.property_a = 'Property A'
21
-
22
- assert_equal 'Property A', @object.property_a
23
-
24
- assert_equal 'Property A', @object.properties[:property_a]
25
- end
26
-
27
- def test_delegates_methods_to_properties
28
- assert_equal @object.properties.inspect, @object.inspect
29
- assert_equal @object.properties.to_s, @object.to_s
30
- end
31
-
32
- def test_hash_access
33
- @object.property_a = 'Property A'
34
-
35
- assert_equal 'Property A', @object[:property_a]
36
- end
37
-
38
- def test_to_hash_conversion
39
- assert_equal @object.properties, @object.to_hash
40
- end
41
-
42
- def test_assign_property_value_as_instance_variable
43
- @object.instance_variable_set(:@property_b, 'Property B')
44
-
45
- assert_equal 'Property B', @object[:property_b]
46
- end
47
-
48
- def test_fill_properties
49
- @object.property_a = 'Property A'
50
-
51
- @object.fill_properties(
52
- property_a: 'Other Value', property_b: 'Property B'
53
- )
54
-
55
- assert_equal 'Property A', @object.property_a
56
- assert_equal 'Property B', @object.property_b
57
- end
58
- end
59
- end