RSpec Aspic

Various tools for RSpec

Install

gem install rspec-aspic

Rails 3

In your Gemfile:

group :test do
  gem "rspec-aspic"
end

In your spec_helper.rb:

require 'rspec-aspic'

RSpec.configure do |config|
  config.include RSpecAspic
end

Usage

Currently, Aspic only contain one helper.

the

describe "POST /categories" do
  before { post "/categories" }

  the(:last_response) { should be_ok }
  the('Category.count') { should eql 2 }
end

... is the equivalent of ...

describe "POST /categories" do
  before { post "/categories" }

  context "last_response" do
    subject { last_response }
    it { should be_ok }
  end

  context "Category.count" do
    subject { Category.count }
    it { should eql 2 }
  end
end

Copyright (c) 2012 De Marque inc. See LICENSE for further details.