Hi all,

I'm trying to use Bacon with MacRuby, and am running into an odd error:

A new array
- should be empty
- should have zero size
- should raise on trying fetch any index
- should have an object identity
- should be a palindrome
- should have super powers [FAILED]

core:in `write:': not opened for writing (IOError)


Running it with "bacon" on the command-line avoids the problem, and 'fails' correctly. :-)

Here's my config -- any suggestions?  Is this a real bug, or user error?

-- Ernie P.


$ macruby --version
MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64]
$ sudo macgem install bacon
$ macgem list

*** LOCAL GEMS ***

bacon (1.1.0)


I am using the whirlwind tutorial for Bacon 1.1:


#!/usr/local/bin/macruby

require 'rubygems'
require 'bacon'
...



#!/usr/local/bin/macruby

require 'rubygems'
require 'bacon'

describe 'A new array' do
  before do
    @ary = Array.new
  end

  it 'should be empty' do
    @ary.should.be.empty
    @ary.should.not.include 1
  end

  it 'should have zero size' do
    @ary.size.should.equal 0
    @ary.size.should.be.close 0.1, 0.5
  end

  it 'should raise on trying fetch any index' do
    lambda { @ary.fetch 0 }.
      should.raise(IndexError).
      message.should.match(/out of array/)

    # Alternatively:
    should.raise(IndexError) { @ary.fetch 0 }
  end

  it 'should have an object identity' do
    @ary.should.not.be.same_as Array.new
  end

  # Custom assertions are trivial to do, they are lambdas returning a
  # boolean vale:
  palindrome = lambda { |obj| obj == obj.reverse }
  it 'should be a palindrome' do
    @ary.should.be.a palindrome
  end

  it 'should have super powers' do
    should.flunk "no super powers found"
  end
end
_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to