Testing ** stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'thor' | |
class Setup < Thor | |
include Thor::Actions | |
CONF_DIR = File.expand_path('..', __FILE__) | |
def self.source_root; ''; end # WTF? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
end | |
module Bar | |
end | |
class Baz < Foo | |
include Bar | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require 'letters' | |
class Foo | |
class Bar < self; end | |
def hello; puts 'world'; end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# So, this is not an uncommon occurence in our specs: | |
describe '...' do | |
describe '...' do | |
context '...' do | |
it '...' do | |
# Oh noes, our line is 80+ chars long! | |
expect { some_object.foo_bar_baz }.to raise_error(Foo::Bar::BazError) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build(-> { 'bar' }) | |
def build(bar) | |
klass = Class.new | |
eigenklass = class << klass; self; end | |
eigenklass.send(:define_method, :bar, bar) | |
end |
def foo
puts 'hello'
end
def foo
puts 'world'
end
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def dedent | |
gsub(/^#{self[/\A\s*/]}/, '') | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
get '/foo/:id' do | |
p params[:id] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
attr_reader :input | |
def initialize(input) | |
@input = input | |
end | |
def bar | |
puts input | |
end |