invoca-utils 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +5 -0
- data/Gemfile +11 -1
- data/Gemfile.lock +2 -2
- data/invoca-utils.gemspec +0 -11
- data/lib/invoca/utils.rb +8 -0
- data/lib/invoca/utils/diff.rb +290 -282
- data/lib/invoca/utils/guaranteed_utf8_string.rb +106 -45
- data/lib/invoca/utils/version.rb +1 -1
- data/test/helpers/constant_overrides.rb +44 -0
- data/test/test_helper.rb +3 -0
- data/test/unit/guaranteed_utf8_string_test.rb +191 -67
- data/test/unit/time_calculations_test.rb +0 -1
- data/test/unit/utils_test.rb +45 -2
- metadata +6 -129
data/test/unit/utils_test.rb
CHANGED
@@ -1,5 +1,48 @@
|
|
1
|
-
require_relative
|
1
|
+
require_relative '../test_helper'
|
2
|
+
require_relative '../helpers/constant_overrides'
|
2
3
|
|
3
4
|
class UtilsTest < Minitest::Test
|
4
|
-
|
5
|
+
include ConstantOverrides
|
6
|
+
|
7
|
+
context "global namespace issues" do
|
8
|
+
setup do
|
9
|
+
setup_constant_overrides
|
10
|
+
end
|
11
|
+
|
12
|
+
teardown do
|
13
|
+
cleanup_constant_overrides
|
14
|
+
end
|
15
|
+
|
16
|
+
should "define Diff as Invoca::Utils::Diff" do
|
17
|
+
assert_equal ::Diff, Invoca::Utils::Diff
|
18
|
+
end
|
19
|
+
|
20
|
+
should "define Diffable as Diffable" do
|
21
|
+
assert_equal ::Diffable, Invoca::Utils::Diffable
|
22
|
+
end
|
23
|
+
|
24
|
+
context "when Diff is defined in the global namespace" do
|
25
|
+
setup do
|
26
|
+
@class = Class.new
|
27
|
+
set_test_const("Diff", @class)
|
28
|
+
load 'invoca/utils.rb'
|
29
|
+
end
|
30
|
+
|
31
|
+
should "not define Diff as Invoca::Utils::Diff" do
|
32
|
+
assert_equal ::Diff, @class
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context "when Diffable is defined in the global namespace" do
|
37
|
+
setup do
|
38
|
+
@class = Class.new
|
39
|
+
set_test_const("Diffable", @class)
|
40
|
+
load 'invoca/utils.rb'
|
41
|
+
end
|
42
|
+
|
43
|
+
should "define Diffable as Invoca::Utils::Diffable" do
|
44
|
+
assert_equal ::Diffable, @class
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
5
48
|
end
|
metadata
CHANGED
@@ -1,141 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: invoca-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cary Penniman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.6'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.6'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: test-unit
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 1.2.3
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - '='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 1.2.3
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rr
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - '='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 1.1.2
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - '='
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 1.1.2
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: shoulda
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - '='
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 3.5.0
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - '='
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 3.5.0
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: pry
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: ruby-prof
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: minitest
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: tzinfo
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
11
|
+
date: 2019-10-29 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
139
13
|
description: A public collection of helpers used in multiple projects
|
140
14
|
email:
|
141
15
|
- cpenniman@invoca.com
|
@@ -144,6 +18,7 @@ extensions: []
|
|
144
18
|
extra_rdoc_files: []
|
145
19
|
files:
|
146
20
|
- ".gitignore"
|
21
|
+
- ".rubocop.yml"
|
147
22
|
- ".ruby-version"
|
148
23
|
- Gemfile
|
149
24
|
- Gemfile.lock
|
@@ -160,6 +35,7 @@ files:
|
|
160
35
|
- lib/invoca/utils/stable_sort.rb
|
161
36
|
- lib/invoca/utils/time.rb
|
162
37
|
- lib/invoca/utils/version.rb
|
38
|
+
- test/helpers/constant_overrides.rb
|
163
39
|
- test/test_helper.rb
|
164
40
|
- test/unit/guaranteed_utf8_string_test.rb
|
165
41
|
- test/unit/map_compact_test.rb
|
@@ -191,6 +67,7 @@ signing_key:
|
|
191
67
|
specification_version: 4
|
192
68
|
summary: A public collection of helpers used in multiple projects
|
193
69
|
test_files:
|
70
|
+
- test/helpers/constant_overrides.rb
|
194
71
|
- test/test_helper.rb
|
195
72
|
- test/unit/guaranteed_utf8_string_test.rb
|
196
73
|
- test/unit/map_compact_test.rb
|