Skip to content

Instantly share code, notes, and snippets.

View ThijsWouters's full-sized avatar

Thijs Wouters ThijsWouters

  • Meerhout, Belgium
View GitHub Profile
@ThijsWouters
ThijsWouters / BatchJob.cls
Last active September 21, 2015 14:47 — forked from mjgallag/BatchJob.cls
Scheduled Batch Job Test Example
global class BatchJob implements Database.Batchable<Account> {
global Account[] start(Database.BatchableContext batchableContext) {return new Account[]{};}
global void execute(Database.BatchableContext batchableContext, Account[] accounts) {}
global void finish(Database.BatchableContext batchableContext) {}
}
@ThijsWouters
ThijsWouters / app.rb
Last active August 29, 2015 14:17
A bug in mustache-sinatra
$:.unshift File.dirname(__FILE__)
require 'sinatra'
require 'mustache/sinatra'
class Example < Sinatra::Base
register Mustache::Sinatra
get '/' do
mustache :index, layout: false
@ThijsWouters
ThijsWouters / matcher_description_spec.rb
Created January 6, 2014 20:07
Descriptions of matchers with an array of strings.
require 'rspec'
describe 'Matcher description' do
it 'returns the correct description' do
[
[be(['foo']), 'equal "foo"'],
[be_a(['foo']), 'be a kind of "foo"'],
[be_an_instance_of(['foo']), 'be an instance of ["foo"]'],
[be_within(['foo']), 'be within ["foo"] of '],
[contain_exactly(['foo']), 'contain exactly ["foo"]'],