Created
January 8, 2016 02:37
-
-
Save YumaInaura/859210e0ebc8e0e15317 to your computer and use it in GitHub Desktop.
Forgery の mock を作る ref: http://qiita.com/Yinaura/items/06879d1307278785e029
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ rspec example_spec.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1 example, 0 failures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment