Skip to content

Commit

Permalink
omg fuck guis in my tests
Browse files Browse the repository at this point in the history
  • Loading branch information
holman committed Mar 30, 2012
1 parent 5520bfd commit dff5ae7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/app')

require 'boot'

task :default => :test
task :default do
ENV['RACK_ENV'] = 'test'
Rake::Task['test'].invoke
end

require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
Expand Down
2 changes: 1 addition & 1 deletion app/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class App < Sinatra::Base
Pusher.secret = Play.config.pusher_secret

Airfoil.enabled = Airfoil.installed?
Airfoil.audio_source = "System Audio" if Airfoil.enabled?
Airfoil.audio_source = "System Audio" if Airfoil.installed?

set :public_folder, "#{dir}/frontend/public"
set :static, true
Expand Down
3 changes: 2 additions & 1 deletion app/models/airfoil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ def self.enabled=(setting)
#
# Returns an Appscript instance of the airfoil app.
def self.app
return false if ENV['RACK_ENV'] == 'test'
Appscript.app('Airfoil')
end

# Check if Airfoil is installed.
#
# Returns Boolean.
def self.installed?
File.exists?('/Applications/Airfoil.app')
File.exists?('/Applications/Airfoil.app') && ENV['RACK_ENV'] != 'test'
end

# Get all the connected speakers.
Expand Down
2 changes: 1 addition & 1 deletion test/airfoil_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
assert_equal @speaker.connected?, speakers[0].connected?
assert_equal @speaker.volume, speakers[0].volume
end
end if Airfoil.installed? and ENV['CI'] != '1'
end if false
2 changes: 1 addition & 1 deletion test/api/speaker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@
Airfoil.enabled = true
end if false

end if Airfoil.installed? and ENV['CI'] != '1'
end if false
2 changes: 1 addition & 1 deletion test/speaker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
assert_equal false, Speaker.valid_id?("wtf_invalid_speaker_id_4815162342")
end

end if Airfoil.installed? and ENV['CI'] != '1'
end if false

0 comments on commit dff5ae7

Please sign in to comment.