Permalink
Browse files

omg fuck guis in my tests

  • Loading branch information...
1 parent 5520bfd commit dff5ae70fd2b10ef9c20131cf28b50389a965001 @holman holman committed Mar 30, 2012
Showing with 10 additions and 6 deletions.
  1. +4 −1 Rakefile
  2. +1 −1 app/app.rb
  3. +2 −1 app/models/airfoil.rb
  4. +1 −1 test/airfoil_test.rb
  5. +1 −1 test/api/speaker_test.rb
  6. +1 −1 test/speaker_test.rb
View
5 Rakefile
@@ -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|
View
2 app/app.rb
@@ -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
View
3 app/models/airfoil.rb
@@ -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.
View
2 test/airfoil_test.rb
@@ -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
View
2 test/api/speaker_test.rb
@@ -111,4 +111,4 @@
Airfoil.enabled = true
end if false
-end if Airfoil.installed? and ENV['CI'] != '1'
+end if false
View
2 test/speaker_test.rb
@@ -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

1 comment on commit dff5ae7

@Arffeh

lol best commit comment of 2012

Please sign in to comment.