diff options
author | Prem Sichanugrist <s@sikachu.com> | 2012-09-01 20:45:26 -0400 |
---|---|---|
committer | Prem Sichanugrist <s@sikac.hu> | 2012-09-17 15:54:22 -0400 |
commit | 21a0b20e397e1b86336f19983c4ee8c368ef55e7 (patch) | |
tree | 1b97e8a23ab526b665f77437dd00de30ddd784ac /guides/source/plugins.md | |
parent | c89c163a0e7df7b29ba33608742eaba09a058090 (diff) | |
download | rails-21a0b20e397e1b86336f19983c4ee8c368ef55e7.tar.gz rails-21a0b20e397e1b86336f19983c4ee8c368ef55e7.tar.bz2 rails-21a0b20e397e1b86336f19983c4ee8c368ef55e7.zip |
change shell to bash
Diffstat (limited to 'guides/source/plugins.md')
-rw-r--r-- | guides/source/plugins.md | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/guides/source/plugins.md b/guides/source/plugins.md index 93998bf26d..eecd4014b4 100644 --- a/guides/source/plugins.md +++ b/guides/source/plugins.md @@ -41,7 +41,7 @@ Rails 3.1 ships with a +rails plugin new+ command which creates a to run integration tests using a dummy Rails application. See usage and options by asking for help: -```shell +```bash $ rails plugin --help ``` @@ -53,7 +53,7 @@ You can navigate to the directory that contains the plugin, run the +bundle inst You should see: -```shell +```bash 2 tests, 2 assertions, 0 failures, 0 errors, 0 skips ``` @@ -80,7 +80,7 @@ end Run +rake+ to run the test. This test should fail because we haven't implemented the +to_squawk+ method: -```shell +```bash 1) Error: test_to_squawk_prepends_the_word_squawk(CoreExtTest): NoMethodError: undefined method `to_squawk' for "Hello World":String @@ -114,13 +114,13 @@ end To test that your method does what it says it does, run the unit tests with +rake+ from your plugin directory. -```shell +```bash 3 tests, 3 assertions, 0 failures, 0 errors, 0 skips ``` To see this in action, change to the test/dummy directory, fire up a console and start squawking: -```shell +```bash $ rails console >> "Hello World".to_squawk => "squawk! Hello World" @@ -191,7 +191,7 @@ end When you run +rake+, you should see the following: -```shell +```bash 1) Error: test_a_hickwalls_yaffle_text_field_should_be_last_squawk(ActsAsYaffleTest): NameError: uninitialized constant ActsAsYaffleTest::Hickwall @@ -209,7 +209,7 @@ This tells us that we don't have the necessary models (Hickwall and Wickwall) th We can easily generate these models in our "dummy" Rails application by running the following commands from the test/dummy directory: -```shell +```bash $ cd test/dummy $ rails generate model Hickwall last_squawk:string $ rails generate model Wickwall last_squawk:string last_tweet:string @@ -218,7 +218,7 @@ $ rails generate model Wickwall last_squawk:string last_tweet:string Now you can create the necessary database tables in your testing database by navigating to your dummy app and migrating the database. First -```shell +```bash $ cd test/dummy $ rake db:migrate $ rake db:test:prepare @@ -266,7 +266,7 @@ ActiveRecord::Base.send :include, Yaffle::ActsAsYaffle You can then return to the root directory (+cd ../..+) of your plugin and rerun the tests using +rake+. -```shell +```bash 1) Error: test_a_hickwalls_yaffle_text_field_should_be_last_squawk(ActsAsYaffleTest): NoMethodError: undefined method `yaffle_text_field' for #<Class:0x000001016661b8> @@ -309,7 +309,7 @@ ActiveRecord::Base.send :include, Yaffle::ActsAsYaffle When you run +rake+ you should see the tests all pass: -```shell +```bash 5 tests, 5 assertions, 0 failures, 0 errors, 0 skips ``` @@ -383,7 +383,7 @@ ActiveRecord::Base.send :include, Yaffle::ActsAsYaffle Run +rake+ one final time and you should see: -```shell +```bash 7 tests, 7 assertions, 0 failures, 0 errors, 0 skips ``` @@ -426,7 +426,7 @@ Once your README is solid, go through and add rdoc comments to all of the method Once your comments are good to go, navigate to your plugin directory and run: -```shell +```bash $ rake rdoc ``` |