This file contains 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
.DS_Store | |
*.csv | |
This file contains 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
# For mocha integration, add this file into features/support folder | |
require "mocha" | |
World(Mocha::Standalone) | |
Before do | |
mocha_setup | |
end |
This file contains 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/bash | |
echo "Setting up chef..." | |
sudo apt-get -y update | |
sudo apt-get -y install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert | |
cd /tmp | |
wget http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz | |
tar zxf rubygems-1.3.4.tgz |
This file contains 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
This example shows how to setup an environment running Rails 3 beta 3 under 1.9.2-head with a 'rails3' gem set. | |
∴ rvm update --head | |
# ((Open a new shell)) or do 'rvm reload' | |
# If you do not already have the ruby interpreter installed, install it: | |
∴ rvm install 1.9.2-head | |
# Switch to 1.9.2-head and gemset rails3, create if it doesn't exist. | |
∴ rvm --create use 1.9.2-head@rails3 |
This file contains 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
-- Used Ubuntu 10.04 Lucid Canonical, ubuntu@ ami-2d4aa444 | |
sudo apt-get install ruby-full build-essential | |
ruby --version | |
sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev | |
sudo apt-get install rubygems | |
sudo gem install rubygems-update | |
sudo /var/lib/gems/1.8/bin/update_rubygems | |
sudo emacs ~/.bashrc | |
-- add the line below and save | |
export PATH=/var/lib/gems/1.8/bin:$PATH |
This file contains 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
# Must have Nokogiri gem installed and save this file in your spec/support dir | |
# Allows you to write cleaner/faster specs in your views (50% faster than css_select) | |
# Increased readability in your spec doc | |
# ex. | |
# rendered.should contain('my heading').within('h1') # searches all H1 tags for 'my heading' | |
# or | |
# rendered.should contain('my string') # searches entire rendered string for 'my string' | |
class Within | |
def initialize(expected, css_selector) | |
@expected = expected |
This file contains 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
module AuthenticationHelpers | |
# Example usage: login mock_user(Editor) | |
def login(user) | |
request.env['warden'] = mock(Warden, | |
:authenticate => user, | |
:authenticate! => user) | |
end | |
def mock_user(type, stubs={}) | |
mock_model(type, stubs).as_null_object |
This file contains 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
def Prefer(value) | |
if value.present? then | |
value | |
else | |
block_given? ? yield : NullObject.new | |
end | |
end |
This file contains 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
describe "Converting integers to roman numerals" do | |
end |
This file contains 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
RSpec::Matchers.define :be_converted_to do |expected| | |
match do |actual| | |
@result = Calculator.convert(actual) | |
@result == expected | |
end | |
failure_message_for_should do | |
"Expected #{actual} to be converted to #{expected}, but got #{@result}" | |
end |
OlderNewer