Skip to content

Instantly share code, notes, and snippets.

View levicole's full-sized avatar

Levi Cole levicole

  • Kolide
  • Nashville, TN
View GitHub Profile
Feature: Managing a cart
In order to purchase an item
As a Shopper
I want to add and remove items to and from my cart
Scenario: Adding an item to my cart
Given I am on the "Baseball Bat" item page
Then I see the add to cart button
When I click the "add to cart" button
Then I am on the cart page
testing Gist.vim
updating
require 'rubygems'
require 'mongo_doc'
require 'mustache'
class Person
attr_accessor :name, :age, :interests
def pretty_interests
last = interests.pop
"#{interests.join(", ")} and #{last}"
end
# so this is super sexy
require 'rubygems'
require 'mongo_doc'
require 'mustache'
class Person < Mustache
attr_accessor :name, :age, :interests
def pretty_interests
last = interests.pop
user.plugins.create(:title => "Blog", :position => (user.plugins.maximum(:position) || -1) +1)
# should be
user.plugins.create(:name => "Blog", :position => (user.plugins.maximum(:position) || -1) +1)
Using the default profile...
........................................F---...........F.....
(::) failed steps (::)
edit_admin_refinery_setting_url failed to generate from {:action=>"edit", :controller=>"admin/refinery_settings"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["refinery", "settings", :id, "edit"] - are they all satisfied? (ActionController::RoutingError)
./vendor/plugins/i18n/lib/routing_filter/routing_filter.rb:78:in `generate'
./vendor/plugins/i18n/lib/i18n_filter.rb:34:in `around_generate'
./vendor/plugins/i18n/lib/routing_filter/routing_filter/base.rb:20:in `send'
./vendor/plugins/i18n/lib/routing_filter/routing_filter/base.rb:20:in `run_reverse'
#! /usr/bin/env ruby
require 'rubygems'
require 'eventmachine'
require 'rbosa'
module MusicServer
def post_init
send_data(currently_playing)
close_connection
end
puts "\n--- watchr initialized ---\n\n"
def cmd() 'script/spec '; end
def run_all_specs
system(cmd + 'spec/')
end
def run_spec(spec)
puts "Running #{spec}"
AUTO_LINK_RE = %r{
( https?:// | www\. )
[^\s<]+
}x unless const_defined?(:AUTO_LINK_RE)
BRACKETS = { ']' => '[', ')' => '(', '}' => '{' }
# Turns all urls into clickable links. If a block is given, each url
# is yielded and the result is used as the link text.
def auto_link_urls(text, html_options = {})
NumberChart.new("4/4") do
line do
measure "1* 5*" #*'s after number indicate the amount of beats to play the chord
measure "4 5**"
measure "1 5**"
measure "4 5", :time_signature => "2/4" # if you need to change the time sig on a meature this is how
end
repeat do
line do
measure "1* 5*"