- Abbreviation used throughout: asop ("as specified on page")
- RailsSpace: Start of Chapter 5 (Getting started with Testing) (p.97)
- Run 'db:test:prepare" using Netbeans. asop 99.
- Watched Chapter 5 screencast.
- Downloaded Listing 5.2 and ran "ruby test/functional/site_controller_test.rb". (p.100) First had to install older version of gem (2.1.0).
- Note the top project directory is $HOME/RAILSPASSION/rails_space.
- Successfully repeated step 3 "rake db:test:prepare" after deleting existing database and starting the database inside netbeans.
- Day 5 starts.
- Repeated step 3 "rake db:test:preapre" outside netbeans (worked after starting database). (p.99)
- Tried step 5 again and got same error message: "ActiveRecord::StatementInvalid: Mysql::Error: #42S22Unknown column 'name' in 'field list': INSERT INTO `users` (`name`, `updated_at`, `id`, `created_at` VALUES" (FIXED LATER)
- Continued on by replacing Listing 5.2 with 5.3 for test/functional/site_controller_test.rb. (p.101)
- Then by replacing Listing 5.3 with 5.4 for test/functional/site_controller_test.rb. (p.103)
- Tried step 10 again and got same error message. (FIXED LATER)
- Then replaced default user_controller_test.rb with Listing 5.5 and ran the test ("ruby user_controller_test.rb") and it worked. (p.g104-105)
- Then replaced default user_controller_test.rb with Listing 5.6 and ran the test ("ruby user_controller_test.rb") and it worked. (p.g106)
- Then replaced default user_controller_test.rb with Listing 5.7 and ran the test ("ruby user_controller_test.rb") and it worked. (p.107)
- Then replaced default user_controller_test.rb with Listing 5.8 and ran the test ("ruby user_controller_test.rb") and it worked. (p.109-110)
- Then replaced default test/unit/user_test.rb with Listing 5.9 and ran the test ("ruby user_test.rb") and it worked. (p.111)
- Then replace Listing 5.10 with Listing 5.11 and ran the test and it worked.
- So I tried "rake test:units" and got this: (in C:/cygwin/home/jasnow/RAILSPASSION/rails_space)
C:/DeepDive/InstantRails-2.0-win/ruby/bin/ruby -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/lib" -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/test" "C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/rake/rake_test_loader
.rb" "test/unit/user_test.rb"
Loaded suite C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/r
ake/rake_test_loader
Started
.
Finished in 0.233 seconds.
1 tests, 1 assertions, 0 failures, 0 errors - So I felt brave and ran and got this: $ rake test:functionals
(in C:/cygwin/home/jasnow/RAILSPASSION/rails_space)
C:/DeepDive/InstantRails-2.0-win/ruby/bin/ruby -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/lib" -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/test" "C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/rake/rake_test_loader.rb" "test/functional/site_controller_test.rb" "test/functional/user_controller_test.rb"
Loaded suite C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/r
ake/rake_test_loader
Started
......
Finished in 0.321 seconds.
6 tests, 30 assertions, 0 failures, 0 errors - Then replaced default test/unit/user_test.rb with Listing 5.12 and ran the test ("ruby user_test.rb") and it worked. (p.113)
- Then replaced default test/unit/user_test.rb with Listing 5.13 and ran the test ("ruby user_test.rb") and it worked. (p.114)
- Then replaced default test/unit/user_test.rb with Listing 5.15 and ran the test ("ruby user_test.rb") and it worked. (p.116)
- Then replaced default test/unit/user_test.rb with Listing 5.17 and ran the test ("ruby user_test.rb") and it worked. (p.117) Got this: Loaded suite test/unit/user_test
Started
.....
Finished in 0.269 seconds.
5 tests, 14 assertions, 0 failures, 0 errors - Then replaced default test/unit/user_test.rb with Listing 5.19 and ran the test ("ruby user_test.rb") and it worked. (p.120) Got this: 7 tests, 20 assertions, 0 failures, 0 errors
- Then replaced default test/unit/user_test.rb with Listing 5.21 and ran the test ("ruby user_test.rb") and it worked. (p.121-122) Got this: 8 tests, 22 assertions, 0 failures, 0 errors
- Then replaced default test/unit/user_test.rb with Listing 5.23 and ran the test ("ruby user_test.rb") and it worked. (p.122) Got this: 9 tests, 29 assertions, 0 failures, 0 errors
- Then replaced default test/unit/user_test.rb with Listing 5.24 and ran the test ("ruby user_test.rb") and it worked. (p.123-124) Got this: 10 tests, 47 assertions, 0 failures, 0 errors
- Then replaced default test/unit/user_test.rb with Listing 5.26 (Listing 5.27 is the same) and ran the test ("ruby user_test.rb") and it worked. (p.124-125) Got this: 12 tests, 53 assertions, 0 failures, 0 errors
- Ran this: $ rake test:units (pg. 128)
(in C:/cygwin/home/jasnow/RAILSPASSION/rails_space)
C:/DeepDive/InstantRails-2.0-win/ruby/bin/ruby -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/lib" -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/test" "C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/rake/rake_test_loader.rb" "test/unit/user_test.rb"
Loaded suite C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/r
ake/rake_test_loader
Started
............
Finished in 0.334 seconds.
12 tests, 53 assertions, 0 failures, 0 errors - Then ran this: $ rake (p.128-129)
(in C:/cygwin/home/jasnow/RAILSPASSION/rails_space)
C:/DeepDive/InstantRails-2.0-win/ruby/bin/ruby -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/lib" -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/test" "C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/rake/rake_test_loader.rb" "test/unit/user_test.rb"
Loaded suite C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/r
ake/rake_test_loader
Started
............
Finished in 0.341 seconds.
12 tests, 53 assertions, 0 failures, 0 errors
C:/DeepDive/InstantRails-2.0-win/ruby/bin/ruby -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/lib" -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/test" "C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/rake/rake_test_loader.rb" "test/functional/site_controller_test.rb" "test/functional/user_controller_test.rb"
Loaded suite C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/r
ake/rake_test_loader
Started
......
Finished in 0.388 seconds.
6 tests, 30 assertions, 0 failures, 0 errors
C:/DeepDive/InstantRails-2.0-win/ruby/bin/ruby -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/lib" -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/test" "C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/rake/rake_test_loader.rb" - Then ran this: $ rake stats (p.129)
(in C:/cygwin/home/jasnow/RAILSPASSION/rails_space)
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 47 | 30 | 3 | 5 | 1 | 4 |
| Helpers | 12 | 10 | 0 | 1 | 0 | 8 |
| Models | 32 | 23 | 1 | 0 | 0 | 0 |
| Libraries | 0 | 0 | 0 | 0 | 0 | 0 |
| Integration tests | 0 | 0 | 0 | 0 | 0 | 0 |
| Functional tests | 129 | 104 | 4 | 10 | 2 | 8 |
| Unit tests | 163 | 113 | 1 | 13 | 13 | 6 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total | 383 | 280 | 9 | 29 | 3 | 7 |
+----------------------+-------+-------+---------+---------+-----+-------+
Code LOC: 63 Test LOC: 217 Code to Test Ratio: 1:3.4 - Done with Chapter 5.
Monday, May 4, 2009
My RailsSpace Journey - Day 3 and 4
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment