Skip to content

Instantly share code, notes, and snippets.

describe User do
it "should be able to subscribe to a plan" do
user.subscribe(plan)
user.should have(1).subscription
end
end
it "should be able to sign up for a plan"
user.sign_up_for(plan)
user.should have(1).plan
if (availability_flag == :available && !current_user.available?) ||
(availability_flag == :unavailable && current_user.available?)
def delegate(*methods)
...
options = methods.pop
...
to = options[:to]
...
prefix = options[:prefix] ? "#{options[:prefix] == true ? to : options[:prefix]}_" : ''
...
end
def delegate(*methods)
...
prefix, to = methods.pop.values_at(:prefix, :to)
...
method_prefix = prefix ? "#{prefix == true ? to : prefix}_" : ''
...
end
def delegate(*methods)
...
prefix, to = methods.pop.values_at(:prefix, :to)
...
method_prefix = prefix ? "#{prefix ? to : prefix}_" : ''
end
def delegate(*methods)
...
prefix, to = methods.pop.values_at(:prefix, :to)
...
method_prefix = if prefix
"#{prefix == true ? to : prefix}_"
else
''
end
...
def delegate(*methods)
...
prefix, to = methods.pop.values_at(:prefix, :to)
...
method_prefix = ''
if prefix
method_prefix = "#{prefix == true ? to : prefix}_"
end
...
end
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet"
href="/Users/light/.vim/plugin/vim-markdown-preview/stylesheets/github.css">