MotionSpec
Specs are important! This project makes them a first-class citizen again.
RubyMotion is great at integrating them from the start, but
they aren't core to the RubyMotion workflow, and lag behind their distant
rspec
cousin (RubyMotion's specs are forked from MacBacon
, which is a port
of Bacon
which is a simplified version of rspec
).
Installation
Add this line to your app's Gemfile
:
gem 'motion-spec'
If your Rakefile
includes this line you're all set:
Bundler.require
Otherwise, you'll need to add this line to the top of your Rakefile
:
require 'motion-spec'
Usage
By Example
describe AwesomeClass do
it 'initializes with defaults' do
expect(AwesomeClass.new.attribute).to eq 'my default'
end
it { expect(true).to be_true }
context 'with a precondition' do
before { AwesomeClass.build_context }
after { AwesomeClass.reset_all }
let(:example_1) { AwesomeClass.new(foo: 'bar') }
subject { example_1.instance_function }
it { is_expected.to have_foo('bar') }
end
end
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/jbender/motion-spec.