Just install this in your apps like so:
gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'
Just install this in your apps like so:
gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'
| ## | |
| # test/spec/mini 5 | |
| # http://gist.github.com/307649 | |
| # [email protected] | |
| # | |
| def context(*args, &block) | |
| return super unless (name = args.first) && block | |
| require 'test/unit' | |
| klass = Class.new(defined?(ActiveSupport::TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase) do | |
| def self.test(name, &block) |
| irbbarnekr@saturnino ~ $ irb | |
| >> def wham(mark, list) | |
| >> list.each {|item| puts "#{item} got whammed!"} | |
| >> end | |
| => nil | |
| >> def subscribe(mark, list, callback) | |
| >> callback.call(mark, list) | |
| >> end | |
| => nil | |
| >> subscribe('one', %w[buddy guy], Proc.new {|*args| wham(*args)}) |
| #!/bin/bash | |
| TARGET_HOST='hoenir.websages.com' | |
| TMP=$(mktemp -d /tmp/sslcert.XXXX) | |
| cat<<EOF > ${TMP}/openssl.cnf | |
| [ req ] | |
| distinguished_name = req_distinguished_name | |
| req_extensions = v3_req | |
| [ req_distinguished_name ] | |
| countryName = Country Name (2 letter code) |
| get '/dalli_test' do | |
| some_var = settings.cache.get('some_var') | |
| if some_var | |
| "some_var is not nil: #{some_var}\n" | |
| else | |
| "some_var is nil: #{some_var}\n" | |
| settings.cache.set('some_var', 'some_value') | |
| end | |
| end |
| #!/usr/bin/env ruby | |
| # | |
| # A quick script to dump an overview of all the open issues in all my github projects | |
| # | |
| require 'octokit' | |
| require 'awesome_print' | |
| require 'rainbow' |
| require "stateful" | |
| class Folder < ActiveRecord::Base | |
| include Stateful | |
| # ... | |
| stateful do | |
| state :active | |
| state :inactive |
| $('div.message').html(function(index, oldhtml) { | |
| return oldhtml.replace(/Removing/,'Fucking') | |
| }); |