Skip to content

Instantly share code, notes, and snippets.

@yjukaku
Last active July 8, 2019 17:32
Show Gist options
  • Save yjukaku/8138580 to your computer and use it in GitHub Desktop.
Save yjukaku/8138580 to your computer and use it in GitHub Desktop.
Play a fail/pass sound after an RSpec Suite without needing any other plugins or gems. This goes in your spec_helper.rb
config.after(:suite) do
examples = RSpec.world.filtered_examples.values.flatten
if examples.none?(&:exception)
file = "spec/pass.wav"
else
file = "spec/fail.wav"
end
fork{exec "play -q -V0 #{file}"}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment