Skip to content

Commit

Permalink
Added CHANGELOG and sample rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
blakewatters committed Jul 16, 2010
1 parent 83a07ac commit 6baa099
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
v0.2.3
-------
- Added UISpecRunner::Options.from_file
- Added rake task example.

v0.2.2
-------
First public release.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ them from Github.
- Support for reading configuration settings from
- A Ruby API for configuring your own spec runners
- Will read common arguments from uispec.opts file for easy per project configuration
- Includes a sample Rakefile for running your UISpec's

## TODO
- Auto-detect SDK versions available
- Rake file template
- Support for running specific files
- Support for running non-headless (either via AppleScript or iphonesim)
- Generate a Kicker script
- Enabling Zombies (or other debugging flags, see http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/UnitTesting/RunIPhoneUnitTest.sh)

## Copyright

Expand Down
3 changes: 1 addition & 2 deletions lib/uispecrunner/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ def self.run!(*arguments)
# Read standard arguments from uispec.opts
options_file = 'uispec.opts'
if File.exists?(options_file)
option_file_args = File.readlines(options_file).map {|l| l.chomp.split " "}.flatten
options = UISpecRunner::Options.new(option_file_args).merge(options)
options = UISpecRunner::Options.from_file(options_file).merge(options)
end

runner = UISpecRunner.new(options)
Expand Down
5 changes: 5 additions & 0 deletions lib/uispecrunner/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ class UISpecRunner
class Options < Hash
attr_reader :opts, :orig_args

def self.from_file(options_file)
args = File.readlines(options_file).map {|l| l.chomp.split " "}.flatten
UISpecRunner::Options.new(args)
end

def initialize(args)
super()

Expand Down
35 changes: 35 additions & 0 deletions tasks/uispec.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
require 'rubygems'

begin
gem 'uispecrunner'
require 'uispecrunner'
require 'uispecrunner/options'
rescue LoadError => error
puts "Unable to load UISpecRunner: #{error}"
end

namespace :uispec do
desc "Run all specs"
task :all do
options = UISpecRunner::Options.from_file('uispec.opts') rescue {}
uispec_runner = UISpecRunner.new(options)
uispec_runner.run_all!
end

desc "Run all unit specs (those that implement UISpecUnit)"
task :units do
options = UISpecRunner::Options.from_file('uispec.opts') rescue {}
uispec_runner = UISpecRunner.new(options)
uispec_runner.run_protocol!('UISpecUnit')
end

desc "Run all integration specs (those that implement UISpecIntegration)"
task :integration do
options = UISpecRunner::Options.from_file('uispec.opts') rescue {}
uispec_runner = UISpecRunner.new(options)
uispec_runner.run_protocol!('UISpecIntegration')
end
end

desc "Run all specs"
task :default => 'uispec:all'
6 changes: 4 additions & 2 deletions uispecrunner.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

Gem::Specification.new do |s|
s.name = %q{uispecrunner}
s.version = "0.2.2"
s.version = "0.2.3"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Blake Watters"]
s.date = %q{2010-07-15}
s.date = %q{2010-07-16}
s.default_executable = %q{uispec}
s.description = %q{Provides a simple Ruby interface for running UISpec iPhone tests}
s.email = %q{blake@twotoasters.com}
Expand All @@ -20,6 +20,7 @@ Gem::Specification.new do |s|
]
s.files = [
".gitignore",
"CHANGELOG",
"LICENSE",
"README.md",
"Rakefile",
Expand All @@ -35,6 +36,7 @@ Gem::Specification.new do |s|
"src/UISpec+UISpecRunner.h",
"src/UISpec+UISpecRunner.m",
"src/main.m",
"tasks/uispec.rake",
"uispecrunner.gemspec"
]
s.homepage = %q{http://github.com/twotoasters/UISpecRunner}
Expand Down

0 comments on commit 6baa099

Please sign in to comment.