paulanthonywilson-iphone_testify 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
  module IphoneTestify
3
3
  GEMDIR = File.expand_path(File.dirname(__FILE__) + "/..")
4
4
  # :stopdoc:
5
- VERSION = '0.1.11'
5
+ VERSION = '0.1.12'
6
6
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
7
7
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
8
8
  # :startdoc:
data/skeleton/autotest.rb CHANGED
@@ -1,3 +1,4 @@
1
+ SIMULATOR_VERSION = "2.2"
1
2
  class String
2
3
  attr_accessor :colour
3
4
  RESET="\e[00;m"
@@ -33,9 +34,9 @@ module AutoTest
33
34
  notice
34
35
  end
35
36
 
36
- def self.test
37
+ def self.run_test
37
38
  puts "Build: #{Time::now}"
38
- output = `xcodebuild -target "Unit Test" -configuration Debug -sdk iphonesimulator2.1 2>&1`
39
+ output = `xcodebuild -target "Unit Test" -configuration Debug -sdk iphonesimulator#{SIMULATOR_VERSION} 2>&1`
39
40
  failure_line = nil
40
41
  output.each do |line|
41
42
  if line =~ /error:|^Executed.*(\d+) failures|Undefined symbols|PurpleSystemEventPort|FAILED|Segmentation fault/
@@ -50,6 +51,22 @@ module AutoTest
50
51
  end
51
52
  failure_line
52
53
  end
54
+
55
+ def self.unable_to_run_test
56
+ "Unable to run tests as the simulator is already running"
57
+ end
58
+
59
+ def self.simulator_running?
60
+ !`ps -AO command`.split("\n").grep(/iPhoneSimulator.platform\/Developer\/Applications\/iPhone Simulator\.app/).empty?
61
+ end
62
+
63
+ def self.test
64
+ if simulator_running?
65
+ unable_to_run_test
66
+ else
67
+ run_test
68
+ end
69
+ end
53
70
 
54
71
  def self.growl title, msg =""
55
72
  img = "~/.autotest_images/#{title.downcase}.png"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paulanthonywilson-iphone_testify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Wilson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-22 00:00:00 -07:00
12
+ date: 2009-05-07 00:00:00 -07:00
13
13
  default_executable: iphone_testify
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.8.3
33
+ version: 0.8.4
34
34
  version:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: bones
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 2.4.2
43
+ version: 2.5.0
44
44
  version:
45
45
  description: Utility to help set up and iPhone project for testing using code from {The Google Toolbox for Mac}[http://code.google.com/p/google-toolbox-for-mac/].
46
46
  email: paul.wilson@merecomplexities.com
@@ -105,7 +105,7 @@ rubyforge_project: !binary |
105
105
 
106
106
  rubygems_version: 1.2.0
107
107
  signing_key:
108
- specification_version: 2
108
+ specification_version: 3
109
109
  summary: Utility to help set up and iPhone project for testing using code from {The Google Toolbox for Mac}[http://code
110
110
  test_files:
111
111
  - test/test_helper.rb