protip 0.12.3 → 0.12.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/protip/wrapper.rb +2 -0
- data/test/unit/protip/wrapper_test.rb +23 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ddcb2b4b3bd6f69e1166447dffb4dc3aa02760c
|
4
|
+
data.tar.gz: 8dedbff1aff8667b6efb681076434fd8dc0405f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f225ba2453ee71bb97c0546f5fb4e702b96f046c612bd85c6b3277658c417138b17bb812c6895f5c6ebace61d8bddf13d792357c11c9ac785bededf41c1426c7
|
7
|
+
data.tar.gz: 600c78b9cb83e256ff1fc9cef872bb68de7040c9a2b6b6a37e4f74c243ac5d83b8e5bf10474254767406458712238f5fd854a5838340d95a5a33c1e781c719b5
|
data/lib/protip/wrapper.rb
CHANGED
@@ -387,6 +387,29 @@ module Protip::WrapperTest # namespace for internal constants
|
|
387
387
|
wrapper.number = :NAN
|
388
388
|
end
|
389
389
|
end
|
390
|
+
|
391
|
+
it 'allows strings to be set for enum fields' do
|
392
|
+
wrapper.number = 'ONE'
|
393
|
+
assert_equal :ONE, wrapper.number
|
394
|
+
end
|
395
|
+
|
396
|
+
it 'allows symbols to be set for enum fields' do
|
397
|
+
wrapper.number = :ONE
|
398
|
+
assert_equal :ONE, wrapper.number
|
399
|
+
end
|
400
|
+
|
401
|
+
it 'allows numbers to be set for enum fields' do
|
402
|
+
wrapper.number = 1
|
403
|
+
assert_equal :ONE, wrapper.number
|
404
|
+
end
|
405
|
+
|
406
|
+
it 'allows symbolizable values to be set for enum fields' do
|
407
|
+
m = mock
|
408
|
+
m.stubs(:to_sym).returns(:ONE)
|
409
|
+
|
410
|
+
wrapper.number = m
|
411
|
+
assert_equal :ONE, wrapper.number
|
412
|
+
end
|
390
413
|
end
|
391
414
|
|
392
415
|
describe '#matches?' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AngelList
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|