From 21a0b20e397e1b86336f19983c4ee8c368ef55e7 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Sat, 1 Sep 2012 20:45:26 -0400 Subject: change shell to bash --- guides/source/plugins.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'guides/source/plugins.md') 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 # @@ -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 ``` -- cgit v1.2.3