1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
setup do
{:a => 23, :b => 43}
end
test "should receive the result of the setup block as a parameter" do |params|
assert params == {:a => 23, :b => 43}
end
test "if the params are modified..." do |params|
params[:a] = nil
end
test "...it should preserve the original values from the setup" do |params|
assert_equal 23, params[:a]
end
setup do
"Hello world!"
end
test "only the most recently defined setup block is executed" do |value|
assert "Hello world!" == value
end
scope do
test "works inside scopes too" do |value|
assert "Hello world!" == value
end
end
|