summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorTom Black <[email protected]>2019-01-10 21:54:08 -0800
committerTom Black <[email protected]>2019-01-10 21:57:24 -0800
commit9c6c062b197b7ce4a1976e2f38289cea3949fc8b (patch)
tree23ae6398640176d87ca3424404fdfe41c1148bbd /test
parent6a58faf836542089eb104f985aee04196207c648 (diff)
downloadruby2d-9c6c062b197b7ce4a1976e2f38289cea3949fc8b.tar.gz
ruby2d-9c6c062b197b7ce4a1976e2f38289cea3949fc8b.zip
WASAPI can't be opened on AppVeyor (Windows)
Diffstat (limited to 'test')
-rw-r--r--test/color_spec.rb2
-rw-r--r--test/music_spec.rb39
-rw-r--r--test/sound_spec.rb10
3 files changed, 31 insertions, 20 deletions
diff --git a/test/color_spec.rb b/test/color_spec.rb
index e22c2c5..1f3f1ec 100644
--- a/test/color_spec.rb
+++ b/test/color_spec.rb
@@ -26,7 +26,7 @@ RSpec.describe Ruby2D::Color do
end
it "accepts an existing color object" do
- expect { Ruby2D::Color.new(Ruby2D::Color.new('red')) }.to_not raise_error Ruby2D::Error
+ expect { Ruby2D::Color.new(Ruby2D::Color.new('red')) }.to_not raise_error
end
it "assigns rgba from an existing color" do
diff --git a/test/music_spec.rb b/test/music_spec.rb
index 0e89b8b..c384c94 100644
--- a/test/music_spec.rb
+++ b/test/music_spec.rb
@@ -2,33 +2,42 @@ require 'ruby2d'
RSpec.describe Ruby2D::Music do
+ # On AppVeyor:
+ # Error: (Mix_OpenAudio) WASAPI can't find requested audio endpoint: Element not found.
+
describe "#new" do
it "raises exception if audio file doesn't exist" do
- expect { Music.new('bad_music.mp3') }.to raise_error(Ruby2D::Error)
+ expect { Music.new('no_music_here.mp3') }.to raise_error(Ruby2D::Error)
end
- it "creates music with options" do
- mus = Music.new('test/media/music.mp3', loop: true)
- expect(mus.path).to eq('test/media/music.mp3')
- expect(mus.loop).to be true
+ unless ENV['APPVEYOR']
+ it "creates music with options" do
+ mus = Music.new('test/media/music.mp3', loop: true)
+ expect(mus.path).to eq('test/media/music.mp3')
+ expect(mus.loop).to be true
+ end
end
end
describe "attributes" do
- it "can be set and read" do
- mus = Music.new('test/media/music.mp3')
- expect(mus.loop).to be false
- mus.loop = true
- expect(mus.loop).to be true
+ unless ENV['APPVEYOR']
+ it "can be set and read" do
+ mus = Music.new('test/media/music.mp3')
+ expect(mus.loop).to be false
+ mus.loop = true
+ expect(mus.loop).to be true
+ end
end
end
describe "#volume" do
- it "sets the volume on music instances" do
- mus = Music.new('test/media/music.mp3')
- expect(mus.volume).to eq(100)
- mus.volume = 68
- expect(mus.volume).to eq(68)
+ unless ENV['APPVEYOR']
+ it "sets the volume on music instances" do
+ mus = Music.new('test/media/music.mp3')
+ expect(mus.volume).to eq(100)
+ mus.volume = 68
+ expect(mus.volume).to eq(68)
+ end
end
it "sets the volume using class methods" do
diff --git a/test/sound_spec.rb b/test/sound_spec.rb
index f181b61..e5f0dc6 100644
--- a/test/sound_spec.rb
+++ b/test/sound_spec.rb
@@ -4,12 +4,14 @@ 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)
+ expect { Sound.new("no_sound_here.wav") }.to raise_error(Ruby2D::Error)
end
- it "creates sound" do
- snd = Sound.new('test/media/music.mp3')
- expect(snd.path).to eq('test/media/music.mp3')
+ unless ENV['APPVEYOR']
+ it "creates sound" do
+ snd = Sound.new('test/media/sound.wav')
+ expect(snd.path).to eq('test/media/sound.wav')
+ end
end
end