[holy ruby programmers batman!] git/svn/patches?

Tim Connor timocratic at gmail.com
Mon Dec 31 20:18:32 EST 2007


Actually, here is my new cleaned up pastie_spec.rb header that drops
all the now unneeded constant mocking, and does a warning free
override of Platform::IMPL, so the specs will run on any machine:
http://pastie.caboo.se/133693


require 'rubygems'
gem 'rspec'
require 'spec'
require File.expand_path(File.join(File.dirname(__FILE__),'..','lib','pastie'))

describe "pastie being called on a mac" do

  before(:all) do
    Platform.send :remove_const, 'IMPL'
    Platform::IMPL = :macosx
    @page = mock('page')
  end

  before(:each) do
    @page.stub!(:body).and_return('href="foo"')
    Net::HTTP.stub!(:post_form).and_return(@page)
    URI.stub!(:parse)
    MacClipboard.stub!(:read)
    MacClipboard.stub!(:write)
    Kernel.stub!(:system)
  end


More information about the Utilitybelt-tinkering mailing list