Skip to content
This repository has been archived by the owner on Aug 10, 2022. It is now read-only.

Commit

Permalink
Made rake test work and gave it rspec style output.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed Jul 29, 2008
1 parent fe5ae8c commit 48591b9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 48 deletions.
35 changes: 2 additions & 33 deletions Rakefile
Expand Up @@ -5,43 +5,12 @@ task :run do
sh "open build/Release/Passenger.prefPane"
end

desc 'This is the normal way to run the tests. The :test_task will run all tests at the same time and fail because of recursive kvc stuff.'
task :test_normal do
Dir.glob("test/*_test.rb").each do |test|
sh "ruby #{test}"
end
end

# This horribly fails due to some recursive kvc stuff.
#
# If oc_import.rb:501 is patched like so it works:
#
# def kvc_writer(*args)
# args.flatten.each do |key|
# setter = key.to_s + '='
# #alias_method kvc_internal_setter(key), setter
# self.class_eval <<-EOE_KVC_WRITER,__FILE__,__LINE__+1
# def #{kvc_setter_wrapper(key)}(value)
# willChangeValueForKey('#{key.to_s}')
# #send('#{kvc_internal_setter(key)}', value)
# @#{key} = value
# didChangeValueForKey('#{key.to_s}')
# end
# EOE_KVC_WRITER
# alias_method setter, kvc_setter_wrapper(key)
# end
# end
require 'rake/testtask'
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/*_test.rb']
t.verbose = true
end

desc 'This test task will run all tests at the same time and fail because of recursive kvc stuff.'
task :test_together do
ENV['TRY_TO_RUN_ALL_TESTS_TOGETHER'] = 'true'
Rake::Task['test'].invoke
t.verbose = nil
t.options = '-rs'
end

desc "Generate Security.framework BridgeSupport file"
Expand Down
2 changes: 1 addition & 1 deletion test/config_installer_test.rb
@@ -1,7 +1,7 @@
require File.expand_path('../test_helper', __FILE__)
require 'config_installer'
require 'yaml'
require 'PassengerApplication'
require File.expand_path('../../PassengerApplication', __FILE__)

describe "ConfigInstaller" do
before do
Expand Down
27 changes: 14 additions & 13 deletions test/passenger_application_test.rb
@@ -1,18 +1,19 @@
require File.expand_path('../test_helper', __FILE__)
require 'PassengerApplication'
require File.expand_path('../../PassengerApplication', __FILE__)
require File.expand_path('../../PassengerPref.rb', __FILE__)

if ENV['TRY_TO_RUN_ALL_TESTS_TOGETHER'] == 'true'
require 'PassengerPref'
else
class PrefPanePassenger
class << self
attr_accessor :sharedInstance
end

def applicationMarkedDirty(app)
end
end
end
# if ENV['TRY_TO_RUN_ALL_TESTS_TOGETHER'] == 'true'
# require 'PassengerPref'
# else
# class PrefPanePassenger
# class << self
# attr_accessor :sharedInstance
# end
#
# def applicationMarkedDirty(app)
# end
# end
# end
PrefPanePassenger.sharedInstance = PrefPanePassenger.new

class Hash
Expand Down
2 changes: 1 addition & 1 deletion test/pref_pane_passenger_test.rb
@@ -1,5 +1,5 @@
require File.expand_path('../test_helper', __FILE__)
require 'PassengerPref'
require File.expand_path('../../PassengerPref', __FILE__)

def OSX._ignore_ns_override; true; end

Expand Down

0 comments on commit 48591b9

Please sign in to comment.