spotify 12.5.0 → 12.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/spotify/managed_pointer.rb +3 -2
- data/lib/spotify/version.rb +1 -1
- data/spec/spotify/managed_pointer_spec.rb +24 -31
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20694ef78fc1b426595ffabf8d655da1875060fc
|
4
|
+
data.tar.gz: 5b99e59242913e03a3a3c1ef5e8e8f3835fbd4a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 042287392a9ad3ea971eb9110b8654e4e757077d6da762c5f43953632f5e99bee6a26e9f4622a73cbe97cd703df3b1e1f03cb6bd805040cc566ad7b252e796f2
|
7
|
+
data.tar.gz: 1bfc03fd117914dc937e3a5cb247f914287250032630aa763051db5acde55ddb0f2760720ed86ea246023567c8f57d4bb7187969106e29ba68699ba4b3ece2cb
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
[HEAD][]
|
2
2
|
-----------
|
3
3
|
|
4
|
+
[v12.5.1][]
|
5
|
+
-----------
|
6
|
+
|
7
|
+
- [b775947d6] Fix retaining class bug on Ruby 1.9.2
|
8
|
+
|
4
9
|
[v12.5.0][]
|
5
10
|
-----------
|
6
11
|
This release *also* breaks backwards-compatibilty, now all functions
|
@@ -185,8 +190,9 @@ v0.0.0
|
|
185
190
|
------
|
186
191
|
- release to register rubygems.org name
|
187
192
|
|
188
|
-
[HEAD]: https://github.com/Burgestrand/spotify/compare/v12.5.
|
193
|
+
[HEAD]: https://github.com/Burgestrand/spotify/compare/v12.5.1...HEAD
|
189
194
|
|
195
|
+
[v12.5.1]: https://github.com/Burgestrand/spotify/compare/v12.5.0...v12.5.1
|
190
196
|
[v12.5.0]: https://github.com/Burgestrand/spotify/compare/v12.4.0...v12.5.0
|
191
197
|
[v12.4.0]: https://github.com/Burgestrand/spotify/compare/v12.3.0...v12.4.0
|
192
198
|
[v12.3.0]: https://github.com/Burgestrand/spotify/compare/v12.2.0...v12.3.0
|
data/lib/spotify/version.rb
CHANGED
@@ -3,68 +3,61 @@ describe Spotify::ManagedPointer do
|
|
3
3
|
let(:klass) { described_class }
|
4
4
|
let(:null) { FFI::Pointer::NULL }
|
5
5
|
let(:pointer) { FFI::Pointer.new(1) }
|
6
|
-
let(:
|
7
|
-
|
8
|
-
def initialize(*)
|
9
|
-
super
|
10
|
-
self.autorelease = false
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.name
|
14
|
-
"Anonymous"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
6
|
+
let(:klass) { Spotify::User }
|
7
|
+
let(:retaining_klass) { klass.retaining_class }
|
18
8
|
|
19
9
|
it "adds a ref if it is a retaining class" do
|
20
|
-
api.should_receive(:
|
21
|
-
|
10
|
+
api.should_receive(:user_add_ref)
|
11
|
+
ptr = retaining_klass.new(FFI::Pointer.new(1))
|
12
|
+
ptr.autorelease = false
|
22
13
|
end
|
23
14
|
|
24
15
|
it "does not add or release when the pointer is null" do
|
25
|
-
api.should_not_receive(:
|
26
|
-
api.should_not_receive(:
|
16
|
+
api.should_not_receive(:user_add_ref)
|
17
|
+
api.should_not_receive(:user_release)
|
27
18
|
|
28
|
-
ptr =
|
19
|
+
ptr = retaining_klass.new(FFI::Pointer::NULL)
|
20
|
+
ptr.autorelease = false
|
29
21
|
ptr.free
|
30
22
|
end
|
31
23
|
|
32
24
|
describe "#release" do
|
33
25
|
it "wraps the release pointer properly to avoid type-failures" do
|
34
|
-
api.should_receive(:
|
35
|
-
pointer.should be_instance_of(
|
26
|
+
api.should_receive(:user_release).and_return do |pointer|
|
27
|
+
pointer.should be_instance_of(klass)
|
36
28
|
pointer.should_not be_autorelease # autorelease should be off
|
37
29
|
end
|
38
30
|
|
39
|
-
ptr =
|
31
|
+
ptr = klass.new(FFI::Pointer.new(1))
|
32
|
+
ptr.autorelease = false
|
40
33
|
ptr.free
|
41
34
|
end
|
42
35
|
end
|
43
36
|
|
44
37
|
describe ".to_native" do
|
45
38
|
it "does not accept null pointers" do
|
46
|
-
expect {
|
47
|
-
expect {
|
39
|
+
expect { klass.to_native(nil, nil) }.to raise_error(TypeError, /cannot be null/)
|
40
|
+
expect { klass.to_native(Spotify::Session.new(null), nil) }.to raise_error(TypeError, /cannot be null/)
|
48
41
|
end
|
49
42
|
|
50
43
|
it "does not accept pointers of another type" do
|
51
|
-
expect {
|
52
|
-
expect {
|
44
|
+
expect { klass.to_native(pointer, nil) }.to raise_error(TypeError, /expected a kind of Spotify::User/)
|
45
|
+
expect { klass.to_native(Spotify::Session.new(pointer), nil) }.to raise_error(TypeError, /expected a kind of Spotify::User/)
|
53
46
|
end
|
54
47
|
|
55
48
|
it "accepts pointers of the same kind, or a subkind" do
|
56
|
-
api.stub(:
|
49
|
+
api.stub(:user_add_ref)
|
57
50
|
|
58
|
-
retaining =
|
51
|
+
retaining = retaining_klass.new(pointer)
|
59
52
|
retaining.autorelease = false
|
60
53
|
|
61
|
-
regular =
|
54
|
+
regular = klass.new(pointer)
|
62
55
|
regular.autorelease = false
|
63
56
|
|
64
|
-
expect {
|
65
|
-
expect {
|
66
|
-
expect {
|
67
|
-
expect {
|
57
|
+
expect { klass.to_native(retaining, nil) }.to_not raise_error
|
58
|
+
expect { klass.to_native(regular, nil) }.to_not raise_error
|
59
|
+
expect { retaining_klass.to_native(retaining, nil) }.to_not raise_error
|
60
|
+
expect { retaining_klass.to_native(regular, nil) }.to_not raise_error
|
68
61
|
end
|
69
62
|
end
|
70
63
|
|