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
/** | |
Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project. | |
If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms. | |
The location of `boot.js` can be specified and/or overridden in `jasmine.yml`. | |
[jasmine-gem]: http://github.com/pivotal/jasmine-gem | |
*/ |
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 Aggregate | |
class CurrentOrganization | |
attr_reader :organization, :spaces, :account | |
def initialize(attrs) | |
@organization = attrs.fetch(:organization) | |
@spaces = attrs.fetch(:spaces) | |
@account = attrs.fetch(:account) | |
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
session = ActionDispatch::Integration::Session.new(Rails.application) | |
session.get('/some/url/your/app/has') | |
body = session.response.body |
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
###################### | |
# A tool for facilitating retros (esp. ones with remote attendees) | |
# Usage: | |
# 1. new up a rando object in an irb session | |
# 2. Add everyone who arrives at the retro by passing strings to the .add method (can take one or many names) | |
# 3. Ask everyone to write topics on notecards (one topic per card). This can be themed ('one thing to change & why'), or not ('happy', 'meh', 'sad') | |
# 4. call .next, ask that person to read their card aloud. Use a timer + do a Roman vote to continue on the topic every 5 min. | |
###################### | |
class Rando |
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("games", function() { | |
subject("game", function() { game }); | |
describe("Basketball Game", function() { | |
given(game, function() { new BasketballGame(); }); | |
its("fieldGoal.points", function() { expect.toEqual(2); }); | |
}) | |
describe("Football Game", function() { | |
given(game, function() { new FootballGame(); }); | |
its("fieldGoal.points", function() { expect.toEqual(3); }); | |
}); |
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
task :kill_spork do | |
spork_processes = `ps aux | grep spork | egrep -v grep | awk '{print $2}'`.split("\n") | |
spork_processes.each do |process| | |
system("kill #{process}") | |
end | |
end | |
task :spec => [:kill_spork, :cucumber] |
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
#!/bin/sh | |
for k in `git branch -r|awk '{print $1}'`;do echo `git show --pretty=format:"%Cgreen%ci %Cblue%cr %Cred%cn %Creset" $k|head -n 1`\\t$k;done|sort -r | |
echo "If you're unable to remove a branch, it may already be gone from the remote. Try git remote prune origin (git remote prune --dry-run origin) to see what remote branch references will be deleted" |
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
/* | |
We have two classes: resultRenderer and dbQuery | |
resultRenderer will ask dbQuery to perform a database query, and asyncronously receives the results | |
*/ | |
function resultRenderer(query) { this._query = query } | |
resultRenderer.prototype = { | |
queryResultsAndRender: function () { | |
this._query.runQueryAsync(this.renderResults.bind(this)); |
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
beforeEach(function() { | |
this.addMatchers({ | |
toEqualSomethingIn : function toEqualSomethingIn(possibleOutputs) { | |
this.message = function() { | |
return [ | |
"Expected " + this.actual + " to be one of the following: "+ possibleOutputs, | |
"Expected " + this.actual + " not to be one of the following: "+ possibleOutputs + ", but it was" | |
]; | |
}; | |
return (possibleOutputs.indexOf(this.actual) != -1) |
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 File.expand_path(File.dirname(__FILE__) + '/../spec_helper') | |
describe "Something doppelganger" do | |
describe "RailCar" do | |
let(:gateway) { RailCar.new :login => "a", :password => "b" } | |
describe "#commit" do | |
let(:response) { railcar.send :commit, request, {} } | |
describe "response" do |
OlderNewer