run_in_isolation

run_in_isolation(&blk) Instance Public methods Crazy H4X to get this working in windows / jruby with no forking.

run_in_isolation

run_in_isolation(&blk) Instance Public methods

test

test(name, &block) Instance Public methods Helper to define a test method using a String. Under the hood, it replaces spaces with underscores and defines the test method. test "verify something" do ... end

describe

describe(text) Class Public methods

assert_not

assert_not(object, message = nil) Instance Public methods Assert that an expression is not truthy. Passes if object is nil or false. âTruthyâ means âconsidered true in a conditionalâ like if foo. assert_not nil # => true assert_not false # => true assert_not 'foo' # => 'foo' is not nil or false An error message can be specified. assert_not foo, 'foo should be false'

assert_no_difference

assert_no_difference(expression, message = nil, &block) Instance Public methods Assertion that the numeric result of evaluating an expression is not changed before and after invoking the passed in block. assert_no_difference 'Article.count' do post :create, article: invalid_attributes end An error message can be specified. assert_no_difference 'Article.count', 'An Article should not be created' do post :create, article: invalid_attributes end

assert_difference

assert_difference(expression, difference = 1, message = nil, &block) Instance Public methods Test numeric difference between the return value of an expression as a result of what is evaluated in the yielded block. assert_difference 'Article.count' do post :create, article: {...} end An arbitrary expression is passed in and evaluated. assert_difference 'assigns(:article).comments(:reload).size' do post :create, comment: {...} end An arbitrary positive or negative difference

create_fixtures

create_fixtures(*fixture_set_names, &block) Instance Public methods

assert_nothing_raised

assert_nothing_raised(*args) Instance Public methods Fails if the block raises an exception. assert_nothing_raised do ... end

for_tag

for_tag(tag) Class Public methods