Provides
let
method for memoized helper definition.
let
method was merged in to Fix
since the version 1.0.0.beta4.
Add this line to your application's Gemfile:
gem 'fix-let'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fix-let
Given this code:
# duck_spec.rb
require 'fix/let'
class Duck
def swims
'So! Swoosh...'
end
end
Fix.describe Duck.new do
let(:famous_word) { 'So!' }
on :swims do
it { MUST eql "#{famous_word} Swoosh..." }
end
end
The output should look like this:
$ ruby duck_spec.rb
.
Ran 1 tests in 0.000243 seconds
100% compliant - 0 infos, 0 failures, 0 errors
- Source code: https://github.com/fixrb/fix-let
Fix::Let follows Semantic Versioning 2.0.
The gem is available as open source under the terms of the MIT License.