This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ruby test_custom_data.rb | |
| Loaded suite test_custom_data | |
| Started | |
| .F.. | |
| Finished in 0.018501 seconds. | |
| 1) Failure: | |
| test_creating_a_thing_with_a_foo(MyTest) [test_custom_data.rb:58]: | |
| <"--- !ruby/object:Foo \nfirst: 1st\nsecond: 2nd\n"> expected but was | |
| <#<Foo:0x1023a5ce8 @first="1st", @second="2nd">>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~/Documents/projects/cucumber/examples/sinatra(master)$ cucumber | |
| Feature: Addition | |
| In order to avoid silly mistakes | |
| As a math idiot | |
| I want to be told the sum of two numbers | |
| Scenario: Add two numbers # features/add.feature:6 | |
| Given I visit the calculator page # features/step_definitions/add_steps.rb:1 | |
| wrong number of arguments (2 for 1) (ArgumentError) | |
| (eval):2:in `visit' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # run the script and pass the path to your mongo/bin | |
| # i.e. | |
| # ruby mongodb_import_test.rb ~/Downloads/mongodb-osx-x86_64-1.0.1/bin | |
| require 'rubygems' | |
| require 'test/unit' | |
| require 'mongo' | |
| include Mongo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| en: | |
| default: | |
| title: "My default title" | |
| users: | |
| index: "My Awesome User index" | |
| show: "{{name}}'s page!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| en: | |
| users: | |
| show: | |
| title: "{{@user.name}} has {{@user.hair.color}} hair" | |
| description: "{{@user.name}}'s page on my site" | |
| keywords: "user, {{@user.name}}, {{page_keywords}}, etc. etc." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| common: &shared | |
| adapter: sqlite3 | |
| pool: 5 | |
| timeout: 5000 | |
| <% %W(development test staging production).each do |env| %> | |
| <%= env %>: | |
| database: rcworkshop_<%= env %>.sqlite3 | |
| <<: *shared | |
| <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # usage: rails new APP_NAME -m http://gist.github.com/627198.txt -TJ | |
| # the -T drops test-unit and the -J drops prototype | |
| gem "pg" | |
| gem "omniauth" | |
| gem "paperclip" | |
| gem "haml" | |
| gem "sass" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # ack the diff with a regexp to | |
| # prevent you from adding lines (the \+ at the beginning indicates an added line in the diff) | |
| # that introduce console.log | |
| # and are not commented out (the \s* before console.log) | |
| has_console_log=$(git diff --cached | ack '^\+\s*console\.log\(.*\)') | |
| if [ "$has_console_log" != "" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # you'll probably want to alias this in one of your dotfiles | |
| # i.e. alias st="ruby -I\"lib:test\" search_and_test.rb" | |
| # | |
| # the -I"lib:test" can be important if you get complaints like "no such file to load -- test_helper (MissingSourceFile)" | |
| ack_opts = [ | |
| "-i", # case insensitive | |
| "-l", # just return file names | |
| "-G _test.rb", # only search files whose name matches /_test.rb/ | |
| ARGV.join(' '), # pass along any options we're passed in (usually just the search string) |