Skip to content

Instantly share code, notes, and snippets.

View cmeiklejohn's full-sized avatar
💭
Always working.

Christopher S. Meiklejohn cmeiklejohn

💭
Always working.
View GitHub Profile
.--.-.
( ( )__
(_, \ ) ,_) |
'-'--`--' ~~| , \ _ /
,|`-._/| -== (_) ==-
^^ .' | /||\ / \
^^ .' | ./ ||`\ |
/ `-. |/._ || \
/ `|| `|;-._\
.--.-.
( ( )__
(_, \ ) ,_) |
'-'--`--' ~~| , \ _ /
,|`-._/| -== (_) ==-
^^ .' | /||\ / \
^^ .' | ./ ||`\ |
/ `-. |/._ || \
/ `|| `|;-._\
@cmeiklejohn
cmeiklejohn / person_test.rb
Created September 20, 2011 20:57 — forked from tenderlove/person_test.rb
Use minitest/spec with Rails 3
require 'test_helper'
require 'minitest/autorun'
module Tenderlove
class Spec < MiniTest::Spec
include ActiveSupport::Testing::SetupAndTeardown
include ActiveRecord::TestFixtures
alias :method_name :__name__ if defined? :__name__
self.fixture_path = File.join(Rails.root, 'test', 'fixtures')
@cmeiklejohn
cmeiklejohn / en.yml
Created September 27, 2011 20:51 — forked from chrisbloom7/README.md
A cheap knock off of the default validates_length_of validator, but checks the filesize of a Carrierwave attachment
# config/locales/en.yml
en:
errors:
messages:
wrong_size: "is the wrong size (should be %{file_size})"
size_too_small: "is too small (should be at least %{file_size})"
size_too_big: "is too big (should be at most %{file_size})"
#http://eggsonbread.com/2010/03/28/my-rspec-best-practices-and-tips/
describe User do
subject { user }
let(:user) { User.new }
context "when name empty" do
it { should_not be_valid }
specify { user.save.should be_false }
end
@cmeiklejohn
cmeiklejohn / person_test.rb
Created October 5, 2011 20:28 — forked from vamsee/person_test.rb
Use minitest/spec with Rails 3
require 'test_helper'
require 'minitest/autorun'
module Tenderlove
class Spec < MiniTest::Spec
include ActiveSupport::Testing::SetupAndTeardown
include ActiveRecord::TestFixtures
alias :method_name :__name__ if defined? :__name__
self.fixture_path = File.join(Rails.root, 'test', 'fixtures')
@cmeiklejohn
cmeiklejohn / methadone.rb
Created October 17, 2011 14:34
argument count with methadone?
executable items list # shows list of items
executable items one_item # shows info about one_item
executable items one_item list # list sub_items of one_item
executable items one_item one_subitem # shows info about items sub_item
class Robocop
include Directive4 # My little contribution to your psychological profile!
end
@cmeiklejohn
cmeiklejohn / rbenv-install-system-wide.sh
Created November 22, 2011 04:59
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
/home/cmeiklejohn/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:167:in `block in non_options': file not found: cucumber (ArgumentError)
from /home/cmeiklejohn/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:146:in `map!'
from /home/cmeiklejohn/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:146:in `non_options'
from /home/cmeiklejohn/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:207:in `non_options'
from /home/cmeiklejohn/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:52:in `process_args'
from /home/cmeiklejohn/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
from /home/cmeiklejohn/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
from /home/cmeiklejohn/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:21:in `run'
from /home/cmeiklejohn/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
from /home/cmeiklejohn/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'