Skip to content

Instantly share code, notes, and snippets.

View troessner's full-sized avatar

Timo Rößner troessner

View GitHub Profile
@skwp
skwp / dynamic_method_spec.rb
Created December 7, 2013 00:44
Fail your build for user-defined style rules.
require 'spec/support/grep_matcher'
describe do
disallow_presence_of pattern: "send(.*#",
location: "app/",
description: "Do not use dynamic method invocations",
failure: "Please change dynamic method call to something more sane."
end
@starkcoffee
starkcoffee / gist:5025548
Last active December 14, 2015 04:08
vim run current and last spec file, and run current spec for line number
function! RunSpec(lineNumber)
wall
let lineNumberSpecified = a:lineNumber
let fname = expand("%")
if fname =~ "spec"
let g:spec = fname
let g:specLineNum = a:lineNumber
endif
if exists("g:spec")
let cmd = '!./script/spin ' . g:spec