Skip to content

Instantly share code, notes, and snippets.

@applicake
Created March 10, 2012 15:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save applicake/2011772 to your computer and use it in GitHub Desktop.
Save applicake/2011772 to your computer and use it in GitHub Desktop.
le spec aliases
require 'spec_helper'
require 'rack/test'
describe App do
include Rack::Test::Methods
le_me { Object.new }
le(:app) { App }
this_is_dog do
le_spec 'gets hello.json' do
get 'hello.json'
last_response.should be_ok
last_response.body.should == {hello: 'world'}.to_json
end
end
end
module LeSpecAliases
def self.included(klass)
klass.instance_eval do
alias :le :let
alias :le_spec :it
alias :le_me :subject
alias :close_enough :pending
alias :this_is_dog :context
end
end
end
RSpec.configuration.send :include, LeSpecAliases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment