name = {FIRSTNAME LASTNAME} email = {EMAIL}
set :keep_releases, 3
rvm ruby-1.9.2-p0@ubuapp
export rvm_pretty_print_flag=1
# TODO = Things you still need to do.
# OPTIMIZE = Code you need to clean-up, refactor etc.
# FIXME = Mark a bug or method that needs to be fixed.
then, use:
$ rake notes
rails generate migration add_quantity_to_line_item quantity:integer
The two patterns that Rails matches on is add_XXX_to_TABLE and remove_XXX_from_TABLE where the value of XXX is ignored: what matters is the list of column names and types that appear after the migration name.
The only thing Rails can’t tell is what a reasonable default is for this column. In many cases a null value would do, but let’s make it the value one for existing carts by modifying the migration before we apply it: media.pragprog.com/titles/rails4/code/depot_g/db/migrate/20100301000004_add_quantity_to_line_item.rb
the standard set of Test::Unit assertions:
assert(boolean, message=nil)
assert_block(message="assert_block failed.") do ... end
assert_equal(expected, actual, message=nil)
assert_in_delta(expected_float, actual_float, delta, message="")
assert_instance_of(klass, object, message="")
assert_kind_of(klass, object, message="")
assert_match(pattern, string, message="")
assert_nil(object, message="")
assert_no_match(regexp, string, message="")
assert_not_equal(expected, actual, message="")
assert_not_nil(object, message="")
assert_not_same(expected, actual, message="")
assert_nothing_raised(*args) do ... end
assert_nothing_thrown(message="") do ... end
assert_operator(object1, operator, object2, message="")
assert_raise(expected_exception_klass, message="") do ... end
assert_respond_to(object, method, message="")
assert_same(expected, actual, message="")
assert_send(send_array, message="")
assert_throws(expected_symbol, message="") do ... end
running 1 test:
$ ruby -Itest test/unit/article_test.rb
gist.github.com/358401
nubyonrails.com/articles/ruby-rails-test-rails-cheat-sheet