spotify_rec 1.10 → 2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/spotify_rec +1 -1
- metadata +2 -4
- data/lib/spec/rec_spec.rb +0 -24
- data/lib/spec/user_spec.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c112153dfb765164519476797cbd6ed028106ab638e047b06f6fa513ca99e203
|
4
|
+
data.tar.gz: ecbe82e8351a06489b79f3062a65af616da4a8be761c0abb9a855d21d1dfe9bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47073db5ad8576c29680218e88ddacb5b2431f715d93e17bd8c1d59e07e96e065996101c3bfe10c072016cb20151f4653a36d265918874e0f30aa0c6ba55e5dc
|
7
|
+
data.tar.gz: a7dab8bd232a72ff7703bbbd707ae1719406512535c64f6921d3e69bbbb1fefb417a41949c07812e290bf85c0b85f0b2c4904f904cfe0ee71c840c806515914a
|
data/bin/spotify_rec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spotify_rec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '
|
4
|
+
version: '2.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Ahale
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-prompt
|
@@ -80,8 +80,6 @@ files:
|
|
80
80
|
- lib/my_list.rb
|
81
81
|
- lib/playlist.rb
|
82
82
|
- lib/rec.rb
|
83
|
-
- lib/spec/rec_spec.rb
|
84
|
-
- lib/spec/user_spec.rb
|
85
83
|
- lib/tutorial.rb
|
86
84
|
- lib/user.rb
|
87
85
|
- public/users.json
|
data/lib/spec/rec_spec.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'rspotify'
|
2
|
-
require_relative '../user'
|
3
|
-
|
4
|
-
RSpotify.authenticate('712ff89a218a4e6dbe1f169e06f949b9', 'e9e0517f405b4a01a1be8823126459b7')
|
5
|
-
|
6
|
-
describe 'Recommendations' do
|
7
|
-
it 'should generate a list of recommendations' do
|
8
|
-
genre = 'pop'
|
9
|
-
recommendations = RSpotify::Recommendations.generate(limit: 5, seed_genres: [genre])
|
10
|
-
expect(recommendations.tracks.length).to eq(5)
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'should take the first recommendation and add it to the user playlist' do
|
14
|
-
name = 'user'
|
15
|
-
password = 'password123'
|
16
|
-
uid = '12345'
|
17
|
-
user = User.new(name, password, uid)
|
18
|
-
genre = 'pop'
|
19
|
-
recommendations = RSpotify::Recommendations.generate(limit: 5, seed_genres: [genre])
|
20
|
-
track = recommendations.tracks.first
|
21
|
-
user.playlist << track
|
22
|
-
expect(user.playlist.length).to eq(1)
|
23
|
-
end
|
24
|
-
end
|
data/lib/spec/user_spec.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../user'
|
4
|
-
require 'json'
|
5
|
-
require 'tty-prompt'
|
6
|
-
|
7
|
-
describe 'User' do
|
8
|
-
it 'should create a user with a name, password and user id' do
|
9
|
-
name = 'user'
|
10
|
-
password = 'password123'
|
11
|
-
uid = '12345'
|
12
|
-
user = User.new(name, password, uid)
|
13
|
-
expect(user.username).to eq('user')
|
14
|
-
expect(user.password).to eq('password123')
|
15
|
-
expect(user.uid).to eq('12345')
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'should create a user and add a track to the users MyList' do
|
19
|
-
name = 'user'
|
20
|
-
password = 'password123'
|
21
|
-
uid = '12345'
|
22
|
-
user = User.new(name, password, uid)
|
23
|
-
song = {
|
24
|
-
'name': 'Gyalchester',
|
25
|
-
'artist': 'Drake',
|
26
|
-
'id': '6UjfByV1lDLW0SOVQA4NAi',
|
27
|
-
'type': 'track'
|
28
|
-
}
|
29
|
-
user.mylist << song
|
30
|
-
expect(user.mylist.first[:name]).to eq('Gyalchester')
|
31
|
-
expect(user.mylist.first[:artist]).to eq('Drake')
|
32
|
-
expect(user.mylist.first[:id]).to eq('6UjfByV1lDLW0SOVQA4NAi')
|
33
|
-
end
|
34
|
-
end
|