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
--colour | |
-I app |
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
Merchant Date Ends Deal Price Value | |
Burger King 10/2/2011 10/4/2011 Your way 25 50 | |
McDonalds 10/5/2011 Not really food 22 44 | |
Arbys 10/8/2011 10/10/2011 More burgers 7 14 |
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
class NullLogger < Logger | |
def initialize(*args); end | |
def write(*input); true; end | |
end | |
Rails.application.assets.logger = NullLogger.new | |
class TemporaryLoggerLevel | |
LEVEL = Logger::ERROR |
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 ModuleStubbing | |
def stubbed_modules | |
@stubbed_modules ||= [] | |
end | |
def stub_module(full_name) | |
most_shallow_stubbed_module = nil | |
full_name.to_s.split(/::/).inject(Object) do |context, name| | |
begin |
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 PostsController do | |
describe "PUT #update" do | |
let(:post) { Factory(:post) } | |
context "when logged in as post's author" do | |
before { sign_in post.author } | |
it "allows the post to be updated" do | |
do_action | |
response.should be_success |
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
require 'forwardable' | |
class BenArray | |
extend Forwardable | |
def initialize | |
@array = [] | |
end | |
def_delegators :@array, :select, :reject, :<< |