rmd 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rmd/version.rb +1 -1
- metadata +2 -48
- data/.bundle/config +0 -2
- data/.gitignore +0 -5
- data/.rspec +0 -2
- data/.travis.yml +0 -7
- data/Gemfile +0 -7
- data/LICENSE.txt +0 -22
- data/README.md +0 -63
- data/Rakefile +0 -10
- data/fixtures/vcr_cassettes/nhaccuatui_playlist.yml +0 -124306
- data/fixtures/vcr_cassettes/nhaccuatui_song.yml +0 -32531
- data/fixtures/vcr_cassettes/song_download.yml +0 -186
- data/fixtures/vcr_cassettes/utils_correct_url_correct.yml +0 -40
- data/fixtures/vcr_cassettes/utils_correct_url_redirect.yml +0 -41
- data/fixtures/vcr_cassettes/zing_playlist.yml +0 -69275
- data/fixtures/vcr_cassettes/zing_song.yml +0 -33334
- data/rmd.gemspec +0 -32
- data/spec/acceptants/main_spec.rb +0 -54
- data/spec/rmd/downloader_spec.rb +0 -61
- data/spec/rmd/factory_spec.rb +0 -64
- data/spec/rmd/nct/getter/key_from_page_spec.rb +0 -140
- data/spec/rmd/nct/getter/key_from_url_spec.rb +0 -113
- data/spec/rmd/nct/playlist_spec.rb +0 -46
- data/spec/rmd/nct/song_spec.rb +0 -57
- data/spec/rmd/processor_spec.rb +0 -62
- data/spec/rmd/song_playlist_adapter_spec.rb +0 -35
- data/spec/rmd/zing/playlist_spec.rb +0 -44
- data/spec/rmd/zing/song_spec.rb +0 -92
- data/spec/rmd/zing/utils/correct_url_spec.rb +0 -28
- data/spec/spec_helper.rb +0 -124
- data/spec/support/download_share_examples.rb +0 -9
- data/spec/support/playlist_share_examples.rb +0 -58
@@ -1,58 +0,0 @@
|
|
1
|
-
shared_examples 'RMD::Base::Playlist' do
|
2
|
-
describe '#success?' do
|
3
|
-
subject { playlist.success? }
|
4
|
-
|
5
|
-
before do
|
6
|
-
allow(playlist).to receive(:songs).and_return(songs)
|
7
|
-
end
|
8
|
-
|
9
|
-
context 'when songs is nil' do
|
10
|
-
let(:songs) { nil }
|
11
|
-
it { is_expected.to eq false }
|
12
|
-
end
|
13
|
-
|
14
|
-
context 'when songs is blank' do
|
15
|
-
let(:songs) { [] }
|
16
|
-
it { is_expected.to eq false }
|
17
|
-
end
|
18
|
-
|
19
|
-
context 'otherwise' do
|
20
|
-
let(:songs) { ['songs'] }
|
21
|
-
it { is_expected.to eq true }
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe '#song_elements' do
|
26
|
-
let(:page) { double('Page') }
|
27
|
-
let(:song_element) { double('playlistElement') }
|
28
|
-
let(:song_elements) { [song_element] }
|
29
|
-
subject { playlist.send(:song_elements) }
|
30
|
-
|
31
|
-
before do
|
32
|
-
expect(playlist).to receive(:page).and_return(page)
|
33
|
-
expect(page).to receive(:search) .with(element_css)
|
34
|
-
.and_return(song_elements)
|
35
|
-
end
|
36
|
-
|
37
|
-
it { is_expected.to eq song_elements }
|
38
|
-
end
|
39
|
-
|
40
|
-
describe '#page' do
|
41
|
-
let(:agent) { instance_double('Mechanize') }
|
42
|
-
let(:page) { double('Page') }
|
43
|
-
subject { playlist.send(:page) }
|
44
|
-
|
45
|
-
before do
|
46
|
-
expect(playlist).to receive(:agent).and_return(agent)
|
47
|
-
expect(agent).to receive(:get).with(link).and_return(page)
|
48
|
-
end
|
49
|
-
|
50
|
-
it { is_expected.to eq page }
|
51
|
-
end
|
52
|
-
|
53
|
-
describe '#agent' do
|
54
|
-
it 'creates agent' do
|
55
|
-
expect(playlist.send(:agent)).to be_a(Mechanize)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|