uispecrunner 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -14,7 +14,12 @@ category header and implementation file as well as a main.m are available
14
14
  in the src/ directory with this gem. Use `gem edit uispecrunner` or pull
15
15
  them from Github.
16
16
 
17
- ## Provides support for:
17
+ *NOTE* - Be sure you update your app delegate class in main.m if necessary.
18
+ Compare the call to `UIApplicationMain` from your normal app's main.m
19
+ to the spec runner. Example:
20
+ `int retVal = UIApplicationMain(argc, argv, nil, @"MyAppDelegateClassHere");`
21
+
22
+ ## Features
18
23
  - Running all specs
19
24
  - Running all specs in a class
20
25
  - Running a specific spec class and method
@@ -25,6 +30,7 @@ them from Github.
25
30
  - A Ruby API for configuring your own spec runners
26
31
  - Will read common arguments from uispec.opts file for easy per project configuration
27
32
  - Includes a sample Rakefile for running your UISpec's
33
+ - Support for setting arbitrary environment variables on the runner
28
34
 
29
35
  ## TODO
30
36
  - Auto-detect SDK versions available
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
data/lib/uispecrunner.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  require 'tmpdir'
6
6
 
7
7
  class UISpecRunner
8
- attr_accessor :project, :target, :configuration, :sdk_version, :build_dir, :verbose, :securityd
8
+ attr_accessor :project, :target, :configuration, :sdk_version, :build_dir, :verbose, :securityd, :env
9
9
 
10
10
  # private
11
11
  attr_accessor :run_mode, :spec, :example, :protocol
@@ -16,6 +16,7 @@ class UISpecRunner
16
16
  self.configuration ||= 'Debug'
17
17
  self.build_dir ||= './build'
18
18
  self.run_mode ||= :all
19
+ self.env ||= {}
19
20
  end
20
21
 
21
22
  def run!
@@ -27,7 +28,7 @@ class UISpecRunner
27
28
  when :example
28
29
  run_spec_example!(self.spec, self.example)
29
30
  when :protocol
30
- run_protocol!(self.protocol_name)
31
+ run_protocol!(self.protocol)
31
32
  else
32
33
  raise ArgumentError, "Unknown run mode: #{run_mode}"
33
34
  end
@@ -78,9 +79,10 @@ class UISpecRunner
78
79
 
79
80
  def run_specs(env = {})
80
81
  if build_project!
81
- env.merge!('DYLD_ROOT_PATH' => sdk_dir, 'IPHONE_SIMULATOR_ROOT' => sdk_dir, 'CFFIXED_USER_HOME' => tmpdir)
82
- puts "Setting environment variables: #{env.inspect}" if verbose?
83
- with_env(env) do
82
+ run_env = self.env.merge(env)
83
+ run_env.merge!('DYLD_ROOT_PATH' => sdk_dir, 'IPHONE_SIMULATOR_ROOT' => sdk_dir, 'CFFIXED_USER_HOME' => tmpdir)
84
+ puts "Setting environment variables: #{run_env.inspect}" if verbose?
85
+ with_env(run_env) do
84
86
  start_securityd if securityd
85
87
  command = "#{build_dir}/#{configuration}-iphonesimulator/#{target}.app/#{target} -RegisterForSystemEvents"
86
88
  puts "Executing: #{command}" if verbose?
@@ -6,8 +6,18 @@
6
6
  // Copyright 2010 Two Toasters. All rights reserved.
7
7
  //
8
8
 
9
+ #import <objc/runtime.h>
9
10
  #import "UISpec+UISpecRunner.h"
10
11
 
12
+ @interface UISpec ()
13
+
14
+ /**
15
+ * Returns YES when a class implement the UISpec protocol
16
+ */
17
+ +(BOOL)isASpec:(Class)class;
18
+
19
+ @end
20
+
11
21
  @implementation UISpec (UISpecRunner)
12
22
 
13
23
  +(BOOL)class:(Class)class conformsToProtocol:(Protocol *)protocol {
data/uispecrunner.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{uispecrunner}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Blake Watters"]
12
- s.date = %q{2010-07-16}
12
+ s.date = %q{2010-07-30}
13
13
  s.default_executable = %q{uispec}
14
14
  s.description = %q{Provides a simple Ruby interface for running UISpec iPhone tests}
15
15
  s.email = %q{blake@twotoasters.com}
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 3
9
- version: 0.2.3
8
+ - 4
9
+ version: 0.2.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Blake Watters
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-16 00:00:00 -04:00
17
+ date: 2010-07-30 00:00:00 -04:00
18
18
  default_executable: uispec
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency