trick_bag 0.38.0 → 0.39.0
Sign up to get free protection for your applications and to get access to all the features.
data/RELEASE_NOTES.md
CHANGED
data/lib/trick_bag/version.rb
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
require 'trick_bag/core_types'
|
3
|
+
|
4
|
+
module TrickBag
|
5
|
+
|
6
|
+
describe CoreTypes do
|
7
|
+
|
8
|
+
include CoreTypes
|
9
|
+
|
10
|
+
specify 'deleting nonexistent keys should produce no error and return the original hash' do
|
11
|
+
h = { a: 1, b: 2 }
|
12
|
+
expect(clone_hash_except(h, [:x, :z])).to eq(h)
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
specify 'deleting keys is successful' do
|
17
|
+
h = { a: 1, b: 2, c: 3, d: 4 }
|
18
|
+
keys_to_delete = [:b, :d]
|
19
|
+
new_h = clone_hash_except(h, keys_to_delete)
|
20
|
+
keys_to_delete.each do |key|
|
21
|
+
expect(new_h.has_key?(key)).to be_false
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
specify 'original hash is unchanged even when keys are deleted' do
|
27
|
+
h = { a: 1, b: 2, c: 3, d: 4 }
|
28
|
+
h_sav = h.clone
|
29
|
+
keys_to_delete = [:b, :d]
|
30
|
+
_ = clone_hash_except(h, keys_to_delete)
|
31
|
+
expect(h).to eq(h_sav)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trick_bag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.39.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: os
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- Rakefile
|
124
124
|
- lib/trick_bag.rb
|
125
125
|
- lib/trick_bag/collections/linked_list.rb
|
126
|
+
- lib/trick_bag/core_types.rb
|
126
127
|
- lib/trick_bag/enumerables/buffered_enumerable.rb
|
127
128
|
- lib/trick_bag/enumerables/compound_enumerable.rb
|
128
129
|
- lib/trick_bag/enumerables/endless_last_enumerable.rb
|
@@ -143,6 +144,7 @@ files:
|
|
143
144
|
- lib/trick_bag/version.rb
|
144
145
|
- spec/spec_helper.rb
|
145
146
|
- spec/trick_bag/collections/linked_list_spec.rb
|
147
|
+
- spec/trick_bag/core_types_spec.rb
|
146
148
|
- spec/trick_bag/enumerables/buffered_enumerable_spec.rb
|
147
149
|
- spec/trick_bag/enumerables/compound_enumerable_spec.rb
|
148
150
|
- spec/trick_bag/enumerables/endless_last_enumerable_spec.rb
|
@@ -189,6 +191,7 @@ summary: Miscellaneous general useful tools.
|
|
189
191
|
test_files:
|
190
192
|
- spec/spec_helper.rb
|
191
193
|
- spec/trick_bag/collections/linked_list_spec.rb
|
194
|
+
- spec/trick_bag/core_types_spec.rb
|
192
195
|
- spec/trick_bag/enumerables/buffered_enumerable_spec.rb
|
193
196
|
- spec/trick_bag/enumerables/compound_enumerable_spec.rb
|
194
197
|
- spec/trick_bag/enumerables/endless_last_enumerable_spec.rb
|