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
testy test test |
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
Feature: Pricing | |
In order to purchase two items from the store | |
As a Store user | |
I should be able to add two items and checkout with the right price displayed | |
Scenario: Successful checkout | |
Given the user adds the "Unique Ability" product to the cart | |
And then adds "Strategy Circle Software" product to the cart | |
When the user views the cart, it should have 2 items totalling "$130" | |
Then the user logs in and confirms the right price |
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
// Suppose we have a useful collection of methods for objects... | |
var Book = { | |
publish : function (publisherUrl) { | |
// do stuff... | |
} | |
, update : function () | |
// do more stuff | |
} |
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
#!/usr/bin/env bash | |
# The following is cribbed directly from the rvm-site project. Please see | |
# https://github.com/wayneeseguin/rvm-site | |
ruby_name="ruby-1.9.2-p136" | |
gemset_name="my_project_name" | |
environment_id="$ruby_name@$gemset_name" | |
# |
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
WARNING: Possible conflict with Rake extension: String#ext already exists | |
WARNING: Possible conflict with Rake extension: String#pathmap already exists | |
/Users/james/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:402: warning: already initialized constant EMPTY_TASK_ARGS | |
/Users/james/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:450: warning: already initialized constant EMPTY | |
/Users/james/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:958: warning: already initialized constant RUBY_EXT | |
/Users/james/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:962: warning: already initialized constant RUBY | |
/Users/james/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:1031: warning: already initialized constant LN_SUPPORTED | |
/Users/james/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:1240: warning: already initialized constant ARRAY_METHODS | |
/Users/james/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:1243: warning: already initialized constant MUST_DEFINE | |
/Users/james/.rvm/rubies/ruby-1.9.2-p180/lib/ |
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
module Attempt | |
def attempt(*method_names) | |
responding_method = method_names.detect { |method| respond_to?(method) } | |
send(responding_method) or raise NoMethodError | |
end | |
end | |
class Object | |
include Attempt | |
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
[2011-06-08 11:20:53] /Users/james/.rvm/wrappers/ruby-1.8.7-p334/ruby ./configure --prefix=/Users/james/.rvm/rubies/rbx-2.0.0pre --enable-version=1.8,1.9 -C --enable-version=1.8,1.9 | |
Usage: configure [options] | |
Configure settings | |
--log-file NAME Write log to file NAME | |
--rake NAME Use NAME as 'rake' during build | |
--tar NAME Use NAME as 'tar' | |
--perl NAME Use NAME as 'perl' during build | |
Language version settings |
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
let(:my_model) { Factory.stub(:my_model) } | |
let(:collection) { [....] } | |
before do | |
my_model.stub(:my_db_method) { collection } | |
end | |
it 'does stuff to illustrate a point' do | |
my_model.should_receive(:my_db_method) { collection } |
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
# Don't do this | |
[].tap do |my_array| | |
collection.each do |item| | |
# process... | |
my_array << item | |
end | |
end | |
# Don't do this | |
collection.each_with_object([]) do |item, my_array| |
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
# Given... | |
function farp { | |
find $1 -type f -exec sed -i $2 {} \; | |
} | |
> farp spec 's/foo/bar/' | |
find: -exec: no terminating ";" or "+" | |
# How do I prevent this error? |