Permalink
Browse files

A simple README

  • Loading branch information...
1 parent c40f952 commit a4e8f97de30450fd5423ff931c22b46eaba5aaef @alloy committed Jul 14, 2010
Showing with 32 additions and 0 deletions.
  1. +32 −0 README.md
View
@@ -0,0 +1,32 @@
+See http://github.com/alloy/UISpec/blob/master/installation.txt for the UISpec install file.
+
+
+An example of a Kicker (http://github.com/alloy/kicker) script to build and run specs continuously:
+
+ require 'tmpdir'
+
+ SDK_DIR = "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk"
+ TMP_USER_HOME = Dir.tmpdir
+
+ def with_env(env)
+ before = env.inject({}) { |h, (k, _)| h[k] = ENV[k]; h }
+ env.each { |k, v| ENV[k] = v }
+ yield
+ ensure
+ before.each { |k, v| ENV[k] = v }
+ end
+
+ def run_specs
+ if system("xcodebuild -project Project.xcodeproj -target UISpecs -configuration Debug -sdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk > /dev/null")
+ with_env('DYLD_ROOT_PATH' => SDK_DIR, 'IPHONE_SIMULATOR_ROOT' => SDK_DIR, 'CFFIXED_USER_HOME' => TMP_USER_HOME) do
+ system "./build/Debug-iphonesimulator/UISpecs.app/UISpecs -RegisterForSystemEvents"
+ end
+ else
+ puts "[!] Failed to build UISpecs.app"
+ end
+ end
+
+ process do |files|
+ run_specs if files.any? { |file| file =~ /Classes|Spec/ }
+ files.clear
+ end

0 comments on commit a4e8f97

Please sign in to comment.