0.0
No commit activity in last 3 years
No release in over 3 years
Quickie adds Object#should, Object#should_not, and Object#stub methods for quick and easy testing of your RubyMotion code
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0
 Project Readme

Quickie for RubyMotion

Quickie for RubyMotion is a gem for quick in-place testing of your RubyMotion code. It provides four useful methods:

  • Object#should and Object#should_not for positive and negative assertions.
  • Object#stub for method stubbing.
  • Kernel#mock for creating object mocks.

Installation

# Installing as Ruby gem
$ gem install quickie_motion

# Cloning the repository
$ git clone git://github.com/michaeldv/quickie_motion.git

Usage

Generate RubyMotion project, then require "quickie_motion" in projects's Rakefile:

# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require "motion/project"
require "quickie_motion"

Motion::Project::App.setup do |app|
  app.name = "your_app_name"
end

Add your Quickie tests to the AppDelegate as follows:

class AppDelegate
  def application(application, didFinishLaunchingWithOptions:launchOptions)
    #
    # Your application code.
    #
    return true if RUBYMOTION_ENV == "release"
    #
    # Your tests.
    #
    quickie do
      run_tests
      run_more_tests
    end 
  end

  private

  def run_tests
    1.should == 1
  end

  def run_more_tests
    true.should_not == false
  end
end

For more information about the usage of assertions and stubs please check http://github.com/michaeldv/quickie.

Testing Quickie for RubyMotion

Quickie code is tested by the Quickie itself.

$ rake quickie
     Build ./build/iPhoneSimulator-6.0-Development
  Simulate ./build/iPhoneSimulator-6.0-Development/quickie_motion_test.app
.....................................

Passed: 37, not quite: 0, total tests: 37.
(main)>

For more details please check quickie_motion_test application in the test directory.

Note on Patches/Pull Requests

  • Fork the project on Github.
  • Make your feature addition or bug fix.
  • Add tests for it making sure $ rake quickie passes 100%.
  • Commit, do not mess with Rakefile, version, or history.
  • Send me commit URL (do not send pull requests).

License

Copyright (c) 2010-2012 Michael Dvorkin

http://www.dvorkin.net

%w(mike dvorkin.net) * "@" || %w(mike fatfreecrm.com) * "@"

Released under the MIT license. See LICENSE file for details.