paulelliott/fabrication — pull request #214 by danielspector (2014-07-17 16:58:38+00:00)
Title: Convert specs to RSpec 2.14.8 syntax with Transpec

Update RSpec suite to new expect syntax using the Transpec gem.

A few syntax types were excluded:

One liners - To enhance readability, one line it... should syntax blocks were ignored
Have Items - Instead of comparing against size, a test that expected have(number).items was kept
Its - Expectations of attrubutes on subject were not converted. This relates mostly to the one-liners.

A summary log of the changes can be found below. The complete changes are available in the diff.

This conversion is done by Transpec 2.3.4 with the following command:
transpec --keep its --keep oneliner --keep have_items

* 122 conversions
from: obj.should
to: expect(obj).to

* 93 conversions
from: == expected
to: eq(expected)

* 10 conversions
from: lambda { }.should
to: expect { }.to

* 10 conversions
from: obj.should_receive(:message)
to: expect(obj).to receive(:message)

* 6 conversions
from: obj.should_not
to: expect(obj).not_to

* 6 conversions
from: obj.stub(:message)
to: allow(obj).to receive(:message)

* 5 conversions
from: === expected
to: be === expected

* 1 conversion
from: obj.should_not_receive(:message)
to: expect(obj).not_to receive(:message)

For more details: https://github.com/yujinakayama/transpec#supported-conversions