1
0
Fork 0

Migrate 'should' syntax to 'expect'

This commit is contained in:
Diego d'Ursel 2015-05-12 19:00:38 +02:00
parent 4dd3db1158
commit f85f74bc2b
2 changed files with 13 additions and 13 deletions

View File

@ -5,28 +5,28 @@ require "spec_helper"
describe MusicBrainz::Recording do
describe '.find' do
it "gets no exception while loading release info" do
lambda {
expect {
MusicBrainz::Recording.find("b3015bab-1540-4d4e-9f30-14872a1525f7")
}.should_not raise_error(Exception)
}.to_not raise_error(Exception)
end
it "gets correct instance" do
track = MusicBrainz::Recording.find("b3015bab-1540-4d4e-9f30-14872a1525f7")
track.should be_an_instance_of(MusicBrainz::Recording)
expect(track).to be_an_instance_of(MusicBrainz::Recording)
end
it "gets correct track data" do
track = MusicBrainz::Recording.find("b3015bab-1540-4d4e-9f30-14872a1525f7")
track.title.should == "Empire"
expect(track.title).to eq "Empire"
end
end
describe '.search' do
it "searches tracks (aka recordings) by artist name and title" do
matches = MusicBrainz::Recording.search('Bound for the floor', 'Local H')
matches.length.should be > 0
matches.first[:title].should == "Bound for the Floor"
matches.first[:artist].should == "Local H"
expect(matches.length).to be > 0
expect(matches.first[:title]).to eq "Bound for the Floor"
expect(matches.first[:artist]).to eq "Local H"
end
end
end

View File

@ -5,21 +5,21 @@ require "spec_helper"
describe MusicBrainz::Track do
describe '.find' do
it "gets no exception while loading release info" do
lambda {
expect {
MusicBrainz::Track.find("b3015bab-1540-4d4e-9f30-14872a1525f7")
}.should_not raise_error(Exception)
}.to_not raise_error(Exception)
end
it "gets correct instance" do
track = MusicBrainz::Track.find("b3015bab-1540-4d4e-9f30-14872a1525f7")
track.should be_an_instance_of(MusicBrainz::Track)
expect(track).to be_an_instance_of(MusicBrainz::Track)
end
it "gets correct track data" do
track = MusicBrainz::Track.find("b3015bab-1540-4d4e-9f30-14872a1525f7")
track.recording_id.should == "b3015bab-1540-4d4e-9f30-14872a1525f7"
track.title.should == "Empire"
track.length.should == 233013
expect(track.recording_id).to eq "b3015bab-1540-4d4e-9f30-14872a1525f7"
expect(track.title).to eq "Empire"
expect(track.length).to eq 233013
end
end
end