Skip to content

Instantly share code, notes, and snippets.

View ClayShentrup's full-sized avatar
🏗️
🗳️🌱🌷🌐🏗️🏓☢️

Clay Shentrup ClayShentrup

🏗️
🗳️🌱🌷🌐🏗️🏓☢️
View GitHub Profile
@ClayShentrup
ClayShentrup / alias_matchers.md
Created December 12, 2017 20:14 — forked from JunichiIto/alias_matchers.md
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@ClayShentrup
ClayShentrup / wrap.rb
Created June 26, 2012 05:04 — forked from garybernhardt/wrap.rb
Probably a really bad implementation of word wrapping
class Wrap < Struct.new(:string, :max_length)
def self.wrap(s, max_length)
raise ArgumentError.new("Maximum wrap length can't be 0") if max_length == 0
new(s, max_length).wrap
end
def wrap
return [""] if blank?
string.scan(regexp)
end