Namlet
Namlet means "named-let" that replaces output of expectation to variable name.
Output
let:
let(:user_a) { User.new }
let(:user_b) { User.new }
it { expect(user_a).to be_friend_of user_b }
=> should be friend of #<User id: 2, ...>
namlet:
let(:user_a) { User.new }
let(:user_b) { User.new }
it { expect(user_a).to be_friend_of user_b }
=> should be friend of user_b
Installation
Add this line to your application's Gemfile:
gem 'namlet'
And then execute:
$ bundle
Or install it yourself as:
$ gem install namlet
Contributing
- Fork it ( http://github.com//namlet/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request