Skip to content

Instantly share code, notes, and snippets.

@biomancer
biomancer / dep_detect.rb
Last active March 20, 2017 16:04
Dirty simple order dependencies detector
## This script can be used to detect simple order dependencies if one of tests is failing when some other test(or tests, independently) is being run before it.
## Script will not give reliable results if the dependency is complex - e.g. two specific tests must be run before for affected one to fail.
## Script will refine results with each rspec run: more runs will result smaller UNSAFE lists. Files from previous script runs are used too
## Ensure that you have config.order = 'random' in RSpec.configure block .
## Running rspec with different seeds to collect data
RSPEC_RUN_COUNT = 5 #set to 0 to analyze already existing rspec_*.txt files
RSPEC_RUN_COUNT.times do
@jess
jess / foundation_menu.rb
Last active February 5, 2016 22:29
Use foundation top bar menu in Refinery CMS
# app/models/foundation_menu
class FoundationMenu < Refinery::Pages::MenuPresenter
private
def render_menu(items)
content_tag(:section, :id => "nav", :class => 'top-bar-section') do
render_menu_items(items)
end
end