How can someone use vanilla
describe MyTest do
it 'tests that number 1 equals 1' do
assert 1 == 1
undefined method `assert' for
You can do this pretty easily:
require 'rspec/core' require 'test/unit' describe 'MyTest' do include Test::Unit::Assertions it 'tests that number 1 equals 1' do assert 1 == 2 end end
(if you want to be able to run the tests by doing
ruby foo.rb then you'll need to require
rspec/autorun too). This pulls in all of those assertions. If you really don't want any extra assertions, just define your own
assert method that raises an exception when the test should fail.
Conversely you can easily use respects expectation syntax outside of rspec by requiring
rspec/expectations - rspec3 is designed to be modular.