Last active
August 29, 2015 14:17
-
-
Save dblessing/9f711d11dfe8743c17e9 to your computer and use it in GitHub Desktop.
Stub IO.read
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 KnifeCookbookDoc::AttributesModel do | |
describe '#load_descriptions' do | |
before do | |
allow(IO).to receive(:read).with('attributes/default.rb').and_return(attributes) | |
end | |
let(:attributes) { | |
<<EOS | |
#<> Single line comment | |
default['knife_cookbook_doc']['attr1'] = 'attr1' | |
#< | |
# Multiline comment with single line of text | |
#> | |
=begin | |
#< | |
Multiline begin/end with single line of text | |
#> | |
EOS | |
} | |
end | |
subject { IO.read('attributes/default.rb') } | |
it { is_expected.to match /thing/ } | |
end | |
---- ERROR: No such file or directory @ rb_sysopen - attributes/default.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment