0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Various tools for RSpec
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0.8.7
>= 2.0
 Project Readme

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

###fixture

describe "fixture" do
  fixture :fx, { 'items' => [1,2,3] } do
    it { should_not be_empty }
    the("fx['items']") { should eql [1,2,3] }
  end
end

is the equivalent of

describe "fixture" do
  context "with the fixture fx {'items'=>[1,2,3]}" do
    let(:fx) { {'items'=>[1,2,3]} }

    subject { fx }

    it { should_not be_empty }
    the("fx['items']") { should eql [1,2,3] }
  end
end

Copyright

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