diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2014-12-11 10:02:05 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2014-12-11 10:02:05 +0100 |
commit | 34a69da36e1a4dd862a360d5bbef749f0f329d2e (patch) | |
tree | 46a96f62ff11b8aa2b4a14dd51584bd9f67c1710 /test/unit/record_spec.rb | |
download | fetch78-34a69da36e1a4dd862a360d5bbef749f0f329d2e.tar.gz fetch78-34a69da36e1a4dd862a360d5bbef749f0f329d2e.tar.bz2 fetch78-34a69da36e1a4dd862a360d5bbef749f0f329d2e.zip |
First commit.
A simple ruby app to download the 78's from
http://78records.cdbpdx.com/
Just because clicking on close to 6000 files is a bit too much.
Diffstat (limited to 'test/unit/record_spec.rb')
-rw-r--r-- | test/unit/record_spec.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/unit/record_spec.rb b/test/unit/record_spec.rb new file mode 100644 index 0000000..c45c958 --- /dev/null +++ b/test/unit/record_spec.rb @@ -0,0 +1,43 @@ +require 'test_helper' + +describe SeventyEights::Record do + describe "when creating a record" do + before do + @r = SeventyEights::Record.new("BamBam", "The Strokes", "Virginia Records", "VR666-1", URI.parse('http://example.com/test.mp3')) + end + + it "must have the correct title" do + @r.title.must_equal "BamBam" + end + + it "must have correct artist" do + @r.artist.must_equal "The Strokes" + end + + it "must have correct label" do + @r.label.must_equal "Virginia Records" + end + + it "must have correct catalog number" do + @r.catalog.must_equal "VR666-1" + end + + it "must have correct URL" do + @r.url.to_s.must_equal 'http://example.com/test.mp3' + end + + it "must generate a sensible filename" do + @r.to_filename.must_equal 'BamBam - The Strokes - Virginia Records - VR666-1.mp3' + end + end + + describe "a record with slashes in a field" do + before do + @r = SeventyEights::Record.new("BamBam", "The Strokes w/Bunny Boo", "Virginia Records", "VR666-1", URI.parse('http://example.com/test.mp3')) + end + + it "must create a valid filename" do + @r.to_filename.must_equal 'BamBam - The Strokes w-Bunny Boo - Virginia Records - VR666-1.mp3' + end + end +end
\ No newline at end of file |