Bring RSpec 3.0 expect syntax to RubyMotion's MacBacon.
expect(view("Tap me")).not_to be_hidden
Expect syntax allows a cleaner implementation because it doesn't need to monkey-patch the Object class to install the should
method.
gem install motion-expect
# or in Gemfile
gem 'motion-expect'
This gem ports most of the built-in matchers found in RSpec 3.0
A full list of matchers examples can be found in the sample app specs.
Examples:
expect(nil).to be_nil
expect(true).not_to be_false
expect("super").to end_with("per")
expect{ 1/0 }.to raise_error(ZeroDivisionError)
expect{ raise ArgumentError.new("with a message") }.to raise_error(ArgumentError, /message/)
expect([1,2,3]).to have(3).items
expect("string").to respond_to(:upcase)