summaryrefslogtreecommitdiffhomepage
path: root/test/sound_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/sound_spec.rb
parent8ce4acf745b27c3f1209b02cc6aeec2c40b5aa1b (diff)
downloadruby2d-f69598768e9a3002d9e7c2acbed109016fac6ae9.tar.gz
ruby2d-f69598768e9a3002d9e7c2acbed109016fac6ae9.zip
Check if audio file exists for `Sound` and `Music`
Diffstat (limited to 'test/sound_spec.rb')
-rw-r--r--test/sound_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/sound_spec.rb b/test/sound_spec.rb
new file mode 100644
index 0000000..72141a7
--- /dev/null
+++ b/test/sound_spec.rb
@@ -0,0 +1,11 @@
+require 'ruby2d'
+
+RSpec.describe Ruby2D::Sound do
+
+ describe '#new' do
+ it "raises exception if audio file doesn't exist" do
+ expect { Sound.new('bad_sound.wav') }.to raise_error(Ruby2D::Error)
+ end
+ end
+
+end