awesome-cheeba 1.0.1 → 1.0.2

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.
data/cheeba.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{cheeba}
5
- s.version = "1.0.1"
5
+ s.version = "1.0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["So Awesome Man"]
@@ -93,6 +93,7 @@ module Cheeba
93
93
  def self.to_adr(adr)
94
94
  m = adr.map {|x|
95
95
  case
96
+ when x.is_a?(Symbol): "[:#{x}]"
96
97
  when x.is_a?(String): "['#{x}']"
97
98
  when x.is_a?(Fixnum): "[#{x}]"
98
99
  end
@@ -1,3 +1,3 @@
1
1
  module Cheeba
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
data/test/test_cheeba.rb CHANGED
@@ -52,6 +52,19 @@ class TestCheeba < MiniTest::Unit::TestCase
52
52
  " 3:",
53
53
  " count: 2",
54
54
  " model: White Wonder Bread"]
55
+ @nested =<<FEKJA
56
+ domain: test
57
+ manifest:
58
+ manifest_id:
59
+ format: String
60
+ master_id:
61
+ format: String
62
+ owner_id:
63
+ format: String
64
+ log_id:
65
+ desc: log of all transactions withing the entire tree
66
+ format: String
67
+ FEKJA
55
68
  end
56
69
 
57
70
  def test_read_hash
@@ -66,6 +79,40 @@ class TestCheeba < MiniTest::Unit::TestCase
66
79
  assert_equal exp, act
67
80
  end
68
81
 
82
+ def test_read_nested_hash_options_symbolize
83
+ exp = {
84
+ :domain => :test,
85
+ :manifest => {
86
+ :manifest_id => {
87
+ :format => :String},
88
+ :master_id => {
89
+ :format => :String},
90
+ :owner_id=>{
91
+ :format => :String},
92
+ :log_id => {
93
+ :desc => :"log of all transactions withing the entire tree",
94
+ :format => :String}}}
95
+ act = Cheeba.read(@nested, {:symbolize => true})
96
+ assert_equal exp, act
97
+ end
98
+
99
+ def test_read_nested_hash_options_symbolize_keys
100
+ exp = {
101
+ :domain=>"test",
102
+ :manifest=>{
103
+ :manifest_id=>{
104
+ :format => "String"},
105
+ :master_id=>{
106
+ :format => "String"},
107
+ :owner_id=>{
108
+ :format => "String"},
109
+ :log_id=>{
110
+ :desc=>"log of all transactions withing the entire tree",
111
+ :format => "String"}}}
112
+ act = Cheeba.read(@nested, {:symbolize_keys => true})
113
+ assert_equal exp, act
114
+ end
115
+
69
116
  def test_read_string
70
117
  str = IO.read("#{@files}/hashes.cash")
71
118
  act = Cheeba.read(str)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awesome-cheeba
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - So Awesome Man