Skip to content

Instantly share code, notes, and snippets.

View dmann's full-sized avatar

Darrin Mann dmann

  • Duke Univeristy
  • Durham, NC
View GitHub Profile
@palkan
palkan / aggregate_failures.rb
Created March 28, 2017 16:54
Rubocop: RSpec/AggregateFailures
require 'rubocop/rspec/language'
module RuboCop
module Cop
module RSpec
class AggregateFailures < RuboCop::Cop::Cop
GROUP_BLOCKS = RuboCop::RSpec::Language::ExampleGroups::ALL
EXAMPLE_BLOCKS = RuboCop::RSpec::Language::Examples::ALL
def on_block(node)
@palkan
palkan / factory_doctor.rb
Created March 27, 2017 15:42
FactoryDoc: detect useless data generation in tests
module FactoryGirl
module Doctor
module FloatDuration
refine Float do
def duration
t = self
format("%02d:%02d.%03d", t / 60, t % 60, t.modulo(1) * 1000)
end
end
end
@palkan
palkan / Gemfile
Last active April 25, 2024 14:23
RSpec profiling with RubyProf and StackProf
gem 'stackprof', require: false
gem 'ruby-prof', require: false