Skip to content

Instantly share code, notes, and snippets.

View rafaelfranca's full-sized avatar
🚆
Focused on Rails

Rafael Mendonça França rafaelfranca

🚆
Focused on Rails
View GitHub Profile
function! RunSpec()
if executable('./bin/spec')
:!./bin/spec %
elseif executable('./bin/rspec')
:!./bin/rspec %
elseif executable('bundle')
:!bundle exec ruby -I'lib:test' %
endif
endfunction
@timblair
timblair / caveatPatchor.js
Created February 15, 2011 10:27 — forked from protocool/caveatPatchor.js
Sample caveatPatchor.js file for use in Propane 1.1.2 and above: pulls avatars from Gravatar
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
require 'spec_helper'
require 'steak'
require 'capybara/rails'
require 'database_cleaner'
require 'akephalos'
DatabaseCleaner.strategy = :truncation
Capybara.default_selector = :css
class ActiveRecord::Base
@dcrec1
dcrec1 / matchers.rb
Created September 17, 2010 22:38
Rails3 RSpec matchers
def should_be_delivered_on_creation_with(clazz)
context "on creation" do
it "should be send on an email" do
mailer = mock(clazz)
clazz.should_receive(subject.class.to_s.underscore).with(an_instance_of(subject.class)).and_return(mailer)
mailer.should_receive :deliver
Factory subject.class.to_s.underscore
end
end
end
require "spec/acceptance/acceptance_helper"
feature "Login", %q{
In order to access my account
As an user
I want to be able to log in
} do
let :user do
Factory :user
@mislav
mislav / backfill-releases.sh
Created February 5, 2014 17:37
Script to migrate releases from CHANGELOG.md to GitHub Releases
#!/bin/bash
# Usage: OAUTH_TOKEN="..." backfill-releases CHANGELOG.md [<project-title>]
set -e
log="${1?}"
project_name="${2}"
repo="$(git config remote.origin.url | grep -oE 'github\.com[/:][^/]+/[^/]+' | sed 's/\.git$//' | cut -d/ -f2-3)"
[ -n "${project_name}" ] || project_name="${repo#*/}"