skn_utils 2.0.6 → 3.0.0
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.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +108 -149
- data/README.rdoc +130 -161
- data/bin/console +8 -0
- data/lib/skn_utils/exploring/configuration.rb +6 -6
- data/lib/skn_utils/nested_result.rb +382 -0
- data/lib/skn_utils/notifier_base.rb +94 -0
- data/lib/skn_utils/version.rb +2 -2
- data/lib/skn_utils.rb +1 -6
- data/skn_utils.gemspec +4 -20
- data/spec/lib/skn_utils/nested_result_spec.rb +268 -0
- data/spec/spec_helper.rb +2 -1
- metadata +27 -36
- data/lib/skn_utils/attribute_helpers.rb +0 -188
- data/lib/skn_utils/generic_bean.rb +0 -20
- data/lib/skn_utils/nested_result_base.rb +0 -123
- data/lib/skn_utils/page_controls.rb +0 -21
- data/lib/skn_utils/result_bean.rb +0 -17
- data/lib/skn_utils/value_bean.rb +0 -20
- data/spec/lib/skn_utils/generic_bean_spec.rb +0 -96
- data/spec/lib/skn_utils/page_controls_spec.rb +0 -124
- data/spec/lib/skn_utils/result_bean_spec.rb +0 -98
- data/spec/lib/skn_utils/value_bean_spec.rb +0 -96
- data/spec/support/shared_example_marshalable_ruby_pojo.rb +0 -54
- data/spec/support/shared_example_ruby_pojo.rb +0 -60
@@ -1,60 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# <root>/spec/support/shared_example_ruby_pojo.rb
|
3
|
-
#
|
4
|
-
# refs: result_bean
|
5
|
-
#
|
6
|
-
|
7
|
-
RSpec.shared_examples "ruby pojo" do
|
8
|
-
it "provides getters" do
|
9
|
-
expect(@obj.one).to eql("one")
|
10
|
-
expect(@obj.two).to eql("two")
|
11
|
-
end
|
12
|
-
it "provides setters" do
|
13
|
-
@obj.one = "1"
|
14
|
-
@obj.two = "2"
|
15
|
-
expect(@obj.two).to eql("2")
|
16
|
-
expect(@obj.one).to eql("1")
|
17
|
-
end
|
18
|
-
it "#clear_attribute sets given attribute to nil." do
|
19
|
-
expect(@obj.two).to eql("two")
|
20
|
-
expect(@obj.clear_two).to be_nil
|
21
|
-
end
|
22
|
-
it "#attribute? returns true or false based on true presence and non-blank contents of attribute." do
|
23
|
-
expect(@obj.two?).to be true
|
24
|
-
@obj.two = false
|
25
|
-
expect(@obj.two?).to be true
|
26
|
-
@obj.clear_two
|
27
|
-
expect(@obj.two?).to be false
|
28
|
-
expect(@obj.three?).to be true
|
29
|
-
@obj.clear_three
|
30
|
-
expect(@obj.three?).to be false
|
31
|
-
end
|
32
|
-
it "#attribute? returns false when attribute is not defined or unknown" do
|
33
|
-
expect(@obj.address?).to be false
|
34
|
-
end
|
35
|
-
it "raises an 'NoMethodError' error when attribute that does not exist is accessed " do
|
36
|
-
expect { @obj.address }.to raise_error NoMethodError
|
37
|
-
end
|
38
|
-
it "#to_hash method returns a hash of all attributes and their values." do
|
39
|
-
expect(@obj.to_hash).to be_a(Hash)
|
40
|
-
expect(@obj.to_hash[:one]).to eql("one")
|
41
|
-
expect(@obj.to_hash[:three]).to be_a(Hash)
|
42
|
-
end
|
43
|
-
it "#attributes method excludes internal attributes unless overridden." do
|
44
|
-
expect(@obj.to_hash[:skn_enabled_depth]).to be_nil
|
45
|
-
expect(@obj.to_hash(false)[:skn_enabled_depth]).to be_nil
|
46
|
-
expect(@obj.to_hash(true)[:skn_enabled_depth]).to eql @obj.depth_level
|
47
|
-
end
|
48
|
-
|
49
|
-
context "transformations are enabled with " do
|
50
|
-
it "#attributes method returns a hash of all attributes and their values." do
|
51
|
-
expect(@obj.to_hash).to be_a(Hash)
|
52
|
-
expect(@obj.to_h).to be_a(Hash)
|
53
|
-
expect(@obj.to_hash[:one]).to be_eql("one")
|
54
|
-
expect(@obj.to_hash[:three]).to be_a(Hash)
|
55
|
-
end
|
56
|
-
it "#to_hash method returns a serialized version of this object." do
|
57
|
-
expect(@obj.to_hash).to be_a(Hash)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|