Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Created January 8, 2016 02:37
Show Gist options
  • Select an option

  • Save YumaInaura/859210e0ebc8e0e15317 to your computer and use it in GitHub Desktop.

Select an option

Save YumaInaura/859210e0ebc8e0e15317 to your computer and use it in GitHub Desktop.
Forgery の mock を作る ref: http://qiita.com/Yinaura/items/06879d1307278785e029
require 'spec_helper'
describe do
subject { Forgery(:basic).text }
before do
allow(Forgery::Basic).to receive(:text).and_return('mocked text')
end
it { should eq 'mocked text' }
end
$ rspec example_spec.rb
1 example, 0 failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment