Sha256: 1a5329218f68313d326eee9a3b914430a73846f8653ddf5e296c9364510aa19b

Contents?: true

Size: 1.23 KB

Versions: 34

Compression:

Stored size: 1.23 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 'should work without arguments' do
      do_install
      lambda { readme_contents }.should.not.raise(ArgumentError)
    end
    
    it 'should accept no arguments' do
      do_install
      lambda { readme_contents(:foo) }.should.raise(ArgumentError)
    end
    
    it 'should read 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 'should return 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

34 entries across 34 versions & 1 rubygems

Version Path
whiskey_disk-0.6.22 spec/install_spec.rb
whiskey_disk-0.6.21 spec/install_spec.rb
whiskey_disk-0.6.20 spec/install_spec.rb
whiskey_disk-0.6.17 spec/install_spec.rb
whiskey_disk-0.6.16 spec/install_spec.rb
whiskey_disk-0.6.15 spec/install_spec.rb
whiskey_disk-0.6.14 spec/install_spec.rb
whiskey_disk-0.6.13 spec/install_spec.rb
whiskey_disk-0.6.12 spec/install_spec.rb
whiskey_disk-0.6.11 spec/install_spec.rb
whiskey_disk-0.6.10 spec/install_spec.rb
whiskey_disk-0.6.4 spec/install_spec.rb
whiskey_disk-0.6.3 spec/install_spec.rb
whiskey_disk-0.6.2 spec/install_spec.rb
whiskey_disk-0.6.0 spec/install_spec.rb
whiskey_disk-0.5.4 spec/install_spec.rb
whiskey_disk-0.5.3 spec/install_spec.rb
whiskey_disk-0.5.2 spec/install_spec.rb
whiskey_disk-0.5.0 spec/install_spec.rb
whiskey_disk-0.4.5 spec/install_spec.rb