gorillib 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/gorillib.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gorillib}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Infochimps"]
@@ -821,4 +821,3 @@ module Gorillib
821
821
 
822
822
  end
823
823
  end
824
-
@@ -119,30 +119,6 @@ module Receiver
119
119
  end
120
120
  end
121
121
 
122
- # # Hashlike#==
123
- # #
124
- # # Equality -- Two hashes are equal if they contain the same number of keys,
125
- # # and the value corresponding to each key in the first hash is equal (using
126
- # # <tt>==</tt>) to the value for the same key in the second. If +obj+ is not a
127
- # # Hashlike, attempt to convert it using +to_hash+ and return <tt>obj ==
128
- # # hsh</tt>.
129
- # #
130
- # # Does not take a default value comparion into account.
131
- # #
132
- # # @example
133
- # # h1 = { :a => 1, :c => 2 }
134
- # # h2 = { 7 => 35, :c => 2, :a => 1 }
135
- # # h3 = { :a => 1, :c => 2, 7 => 35 }
136
- # # h4 = { :a => 1, :d => 2, :f => 35 }
137
- # # h1 == h2 # => false
138
- # # h2 == h3 # => true
139
- # # h3 == h4 # => false
140
- # #
141
- # def ==(other_hash)
142
- # (length == other_hash.length) &&
143
- # all?{|k,v| v == other_hash[k] }
144
- # end
145
-
146
122
  # Hashlike#keys
147
123
  #
148
124
  # Returns a new array populated with the keys from this hashlike.
@@ -186,6 +162,7 @@ module Receiver
186
162
 
187
163
  def self.included base
188
164
  base.extend ClassMethods
165
+ base.send(:include, Gorillib::Hashlike)
189
166
  end
190
167
  end
191
168
  end
@@ -16,51 +16,55 @@ STRUCT_HASHLIKE_METHODS_TO_SKIP = [:each, :flatten, :clear, :values_at] +
16
16
  Enumerable.public_instance_methods.map(&:to_sym) +
17
17
  HashlikeHelper::HASH_METHODS_MISSING_FROM_VERSION
18
18
 
19
- include HashlikeFuzzingHelper
19
+ describe Gorillib::Struct::ActsAsHash do
20
+ if ENV['FULL_SPECS']
21
+ include HashlikeFuzzingHelper
20
22
 
21
- describe "Hash vs Gorillib::Struct::ActsAsHash" do
22
- before do
23
- @total = 0
24
- @hsh = HashlikeHelper::HASH_TO_TEST_HASHLIKE_STRUCT.dup
25
- @hshlike = StructUsingHashlike.new.merge(HashlikeHelper::HASH_TO_TEST_HASHLIKE_STRUCT)
26
- end
23
+ describe "vs Hash" do
24
+ before do
25
+ @total = 0
26
+ @hsh = HashlikeHelper::HASH_TO_TEST_HASHLIKE_STRUCT.dup
27
+ @hshlike = StructUsingHashlike.new.merge(HashlikeHelper::HASH_TO_TEST_HASHLIKE_STRUCT)
28
+ end
27
29
 
28
- ( HashlikeHelper::METHODS_TO_TEST - STRUCT_HASHLIKE_METHODS_TO_SKIP ).each do |method_to_test|
29
- describe "##{method_to_test}" do
30
+ ( HashlikeHelper::METHODS_TO_TEST - STRUCT_HASHLIKE_METHODS_TO_SKIP ).each do |method_to_test|
31
+ describe "##{method_to_test}" do
30
32
 
31
- (HashlikeFuzzingHelper::INPUTS_FOR_ALL_HASHLIKES).each do |input|
32
- next if HashlikeFuzzingHelper::SPECIAL_CASES_FOR_HASHLIKE_STRUCT[method_to_test].include?(input)
33
+ (HashlikeFuzzingHelper::INPUTS_FOR_ALL_HASHLIKES).each do |input|
34
+ next if HashlikeFuzzingHelper::SPECIAL_CASES_FOR_HASHLIKE_STRUCT[method_to_test].include?(input)
33
35
 
34
- it "on #{input.inspect}" do
35
- behaves_the_same(@hsh, @hshlike, method_to_test, input)
36
+ it "on #{input.inspect}" do
37
+ behaves_the_same(@hsh, @hshlike, method_to_test, input)
38
+ end
39
+ end
36
40
  end
37
41
  end
38
42
  end
39
- end
40
- end
41
43
 
42
- describe "Gorillib::HashWithIndifferentSymbolKeys vs Gorillib::Struct::ActsAsHash" do
43
- before do
44
- @total = 0
45
- @hsh = Gorillib::HashWithIndifferentSymbolKeys.new_from_hash_copying_default(
46
- HashlikeHelper::HASH_TO_TEST_HASHLIKE_STRUCT)
47
- @hshlike = StructUsingHashlike.new.merge(
48
- HashlikeHelper::HASH_TO_TEST_HASHLIKE_STRUCT)
49
- end
44
+ describe "vs Gorillib::HashWithIndifferentSymbolKeys" do
45
+ before do
46
+ @total = 0
47
+ @hsh = Gorillib::HashWithIndifferentSymbolKeys.new_from_hash_copying_default(
48
+ HashlikeHelper::HASH_TO_TEST_HASHLIKE_STRUCT)
49
+ @hshlike = StructUsingHashlike.new.merge(
50
+ HashlikeHelper::HASH_TO_TEST_HASHLIKE_STRUCT)
51
+ end
50
52
 
51
- ( HashlikeHelper::METHODS_TO_TEST - STRUCT_HASHLIKE_METHODS_TO_SKIP
52
- ).each do |method_to_test|
53
- describe "##{method_to_test}" do
53
+ ( HashlikeHelper::METHODS_TO_TEST - STRUCT_HASHLIKE_METHODS_TO_SKIP
54
+ ).each do |method_to_test|
55
+ describe "##{method_to_test}" do
54
56
 
55
- ( HashlikeFuzzingHelper::INPUTS_WHEN_INDIFFERENT_ACCESS +
56
- HashlikeFuzzingHelper::INPUTS_FOR_ALL_HASHLIKES
57
- ).each do |input|
58
- next if HashlikeFuzzingHelper::SPECIAL_CASES_FOR_HASHLIKE_STRUCT[method_to_test].include?(input)
57
+ ( HashlikeFuzzingHelper::INPUTS_WHEN_INDIFFERENT_ACCESS +
58
+ HashlikeFuzzingHelper::INPUTS_FOR_ALL_HASHLIKES
59
+ ).each do |input|
60
+ next if HashlikeFuzzingHelper::SPECIAL_CASES_FOR_HASHLIKE_STRUCT[method_to_test].include?(input)
59
61
 
60
- it "on #{input.inspect}" do
61
- behaves_the_same(@hsh, @hshlike, method_to_test, input)
62
- end
62
+ it "on #{input.inspect}" do
63
+ behaves_the_same(@hsh, @hshlike, method_to_test, input)
64
+ end
63
65
 
66
+ end
67
+ end
64
68
  end
65
69
  end
66
70
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gorillib
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Infochimps
@@ -315,7 +315,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
315
315
  requirements:
316
316
  - - ">="
317
317
  - !ruby/object:Gem::Version
318
- hash: 973162575614506299
318
+ hash: 2181950979362360273
319
319
  segments:
320
320
  - 0
321
321
  version: "0"