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
| require "rubygems" | |
| require "spec" | |
| class AccountService | |
| def withdraw(account, amount) | |
| account.debit(amount) | |
| end | |
| def deposit(account, amount) | |
| account.credit(amount) |
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
| When player wins he should be paid 1-1 | |
| When player loses, he is not paid | |
| When player has blackjack, he is paid 1.5-1 | |
| Scenario: <Scenario title> | |
| Given <some known state> | |
| And <some more known state> | |
| When <I do something> | |
| Then <some desired outcome> |
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
| # When I run the specs above, the following error occurs: | |
| $ script/spec -c spec/controllers/strange_name_error.rb | |
| ./spec/controllers/strange_name_error.rb:15: undefined local variable or method `properties_url' for #<Class:0x22b918c> (NameError) | |
| from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:68:in `module_eval' | |
| from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:68:in `create_nested_example_group' | |
| from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/extensions/class.rb:14:in `instance_eval' | |
| from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/extensions/class.rb:14:in `subclass' | |
| from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:66:in `create_nested_example_group' | |
| from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:53:in `describe' |
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
| This is just a test thing, to see how gist.el works |
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 Twinkies | |
| class Item | |
| include DataMapper::Resource | |
| property :id, Integer, :serial => true | |
| property :twitter_id, Integer | |
| property :link, String | |
| property :user, String | |
| property :created_at, DateTime | |
| property :text, Text, :lazy => false | |
| property :guid, String, :default => Proc.new { Guid.new.to_s } |
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
| require 'rubygems' | |
| require 'grit' | |
| require 'gruff' | |
| module GotGit | |
| class Repo | |
| def initialize(url) | |
| @repo = Grit::Repo.new url | |
| 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
| require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') | |
| describe IncentivesController do | |
| integrate_views | |
| describe "GET /incentives" do | |
| it "should work" do | |
| get :index | |
| response.should be_success | |
| 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
| require 'sinatra/base' | |
| module Griki | |
| class Server < Sinatra::Base | |
| enable :static | |
| def initialize(repository, app=nil) | |
| @repository = repository | |
| super app | |
| options.root = @repository.root |
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
| require 'rubygems' | |
| require 'spec' | |
| class Mine | |
| attr_reader :foo, :bar | |
| def initialize | |
| @foo = 'unchanged' | |
| @bar = 'unchanged' | |
| 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
| create.response do |wants| | |
| wants.html { redirect_to welcome_user_path(@user) } | |
| end |
OlderNewer