summaryrefslogtreecommitdiffhomepage
path: root/test/music_spec.rb
diff options
context:
space:
mode:
authorTom Black <[email protected]>2017-05-19 22:24:02 -0400
committerTom Black <[email protected]>2017-05-20 18:15:53 -0400
commitf69598768e9a3002d9e7c2acbed109016fac6ae9 (patch)
treec716af50d3d98676704518ce9ab84f9afb7368f4 /test/music_spec.rb
parent8ce4acf745b27c3f1209b02cc6aeec2c40b5aa1b (diff)
downloadruby2d-f69598768e9a3002d9e7c2acbed109016fac6ae9.tar.gz
ruby2d-f69598768e9a3002d9e7c2acbed109016fac6ae9.zip
Check if audio file exists for `Sound` and `Music`
Diffstat (limited to 'test/music_spec.rb')
-rw-r--r--test/music_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/music_spec.rb b/test/music_spec.rb
new file mode 100644
index 0000000..4b4e432
--- /dev/null
+++ b/test/music_spec.rb
@@ -0,0 +1,11 @@
+require 'ruby2d'
+
+RSpec.describe Ruby2D::Music do
+
+ describe '#new' do
+ it "raises exception if audio file doesn't exist" do
+ expect { Music.new('bad_music.mp3') }.to raise_error(Ruby2D::Error)
+ end
+ end
+
+end