Created
March 10, 2012 15:24
-
-
Save applicake/2011772 to your computer and use it in GitHub Desktop.
le spec aliases
This file contains 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 '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 |
This file contains 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
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