Sha256: 2681810a8e1dee7491075da05ce544b59bfa985dc0f60c09f676b23a24ac595c
Contents?: true
Size: 1.21 KB
Versions: 5
Compression:
Stored size: 1.21 KB
Contents
require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper')) def do_install eval File.read(File.join(File.dirname(__FILE__), *%w[.. install.rb ])) end describe 'the plugin install.rb script' do before do self.stub!(:puts).and_return(true) end it 'displays the content of the plugin README file' do self.stub!(:readme_contents).and_return('README CONTENTS') self.should.receive(:puts).with('README CONTENTS') do_install end describe 'readme_contents' do it 'works without arguments' do do_install lambda { readme_contents }.should.not.raise(ArgumentError) end it 'accepts no arguments' do do_install lambda { readme_contents(:foo) }.should.raise(ArgumentError) end it 'reads the plugin README file' do do_install File.stub!(:join).and_return('/path/to/README') IO.should.receive(:read).with('/path/to/README') readme_contents end it 'returns the contents of the plugin README file' do do_install File.stub!(:join).and_return('/path/to/README') IO.stub!(:read).with('/path/to/README').and_return('README CONTENTS') readme_contents.should == 'README CONTENTS' end end end
Version data entries
5 entries across 5 versions & 3 rubygems