ryo.rb 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/ryo/version.rb +1 -1
- data/lib/ryo.rb +1 -0
- data/spec/ryo_basic_object_spec.rb +7 -0
- data/spec/ryo_object_spec.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dab9ce575cc86bc7fc740dc72d1a1c416a22d36ed8806b86e1c7f60c0b46f5b
|
4
|
+
data.tar.gz: 403f51fb967e4c745461a61092984f78de8fac139465da0442cd30dea66c807d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcac875bbd985395ffa37b1b3c48e9f52ebd11d36514faf75e18134530fc2599fbac437114d3d9c2530a66aec810cc7de8904355467a9854d9a9b4f80f2c63f6
|
7
|
+
data.tar.gz: bbb67ac56137b8989b8c94f82b20c887d3914d7218170ded3688e8f53251d2ef1808af4a143e469c374951031a1ab40b3f8ed6cf0ce084ee72f078ad2022446f
|
data/README.md
CHANGED
data/lib/ryo/version.rb
CHANGED
data/lib/ryo.rb
CHANGED
@@ -64,5 +64,12 @@ RSpec.describe Ryo::BasicObject do
|
|
64
64
|
it { expect(h).to be_instance_of(Hash) }
|
65
65
|
it { expect(h["wheels"]).to be_instance_of(Hash) }
|
66
66
|
it { expect(h).to eq({"name" => "ford", "wheels" => {"quantity" => 4}}) }
|
67
|
+
|
68
|
+
context "when given to Hash#merge" do
|
69
|
+
let(:car) { Ryo(name: "ford") }
|
70
|
+
subject { {}.merge(car) }
|
71
|
+
it { is_expected.to be_instance_of(Hash) }
|
72
|
+
it { is_expected.to eq({"name" => "ford"})}
|
73
|
+
end
|
67
74
|
end
|
68
75
|
end
|
data/spec/ryo_object_spec.rb
CHANGED
@@ -59,6 +59,13 @@ RSpec.describe "Ryo objects" do
|
|
59
59
|
it { expect(h).to be_instance_of(Hash) }
|
60
60
|
it { expect(h["wheels"]).to be_instance_of(Hash) }
|
61
61
|
it { expect(h).to eq({"name" => "ford", "wheels" => {"quantity" => 4}}) }
|
62
|
+
|
63
|
+
context "when given to Hash#merge" do
|
64
|
+
let(:car) { Ryo(name: "ford") }
|
65
|
+
subject { {}.merge(car) }
|
66
|
+
it { is_expected.to be_instance_of(Hash) }
|
67
|
+
it { is_expected.to eq({"name" => "ford"})}
|
68
|
+
end
|
62
69
|
end
|
63
70
|
|
64
71
|
describe "when a property overshadows a method" do
|