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
- (void)testCanExpectSingleMethodCallAndPass | |
{ | |
id<SomeProtocol> testObject = [context protocolMock:@protocol(SomeProtocol)]; | |
[context check:^{ | |
[[expectThat(testObject) receives] doSomething]; | |
}]; | |
[testObject doSomething]; | |
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 Organization | |
def initialize(parameters = {}) | |
@parameters = parameters | |
end | |
def to_param | |
"42" | |
end | |
def valid? |
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
# By default, rspec/rails tags all specs in spec/integration as request specs, | |
# which is not what we want. There does not appear to be a way to disable this | |
# behaviour, so this file is a copy of rspec/rails.rb with this default | |
# behaviour commented out. | |
require 'rspec/core' | |
RSpec::configure do |c| | |
c.backtrace_clean_patterns << /vendor\// | |
c.backtrace_clean_patterns << /lib\/rspec\/rails/ | |
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
require "active_record" | |
ActiveRecord::Base.establish_connection( | |
:adapter => "sqlite3", | |
:dbfile => "test.sqlite3" | |
) | |
ActiveRecord::Schema.define do | |
create_table "things" do |t| | |
t.column "flag", :bool |
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 Array | |
def move_to_front_of_line(x) | |
unshift(delete(self[x])) | |
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
#!/usr/bin/env ruby | |
require 'fileutils' | |
if ARGV.empty? | |
puts "Usage: #{__FILE__} <repository> <repository> ..." | |
exit -1 | |
end | |
created_flags = [] |