rmd 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +0,0 @@
1
- shared_examples 'download' do
2
- it 'downloads' do
3
- VCR.use_cassette(scenario) do
4
- capture_io { run_method }
5
- expect(File.exists?(file_path)).to eq true
6
- end
7
- File.delete(file_path)
8
- end
9
- end
@@ -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