Skip to content

Instantly share code, notes, and snippets.

@avh4
Created March 29, 2009 06:52
Show Gist options
  • Save avh4/87303 to your computer and use it in GitHub Desktop.
Save avh4/87303 to your computer and use it in GitHub Desktop.
the describe_project method doesn't work as I'm expecting it to. The following will not run the before block for each of the tests.
require File.dirname(__FILE__) + '/../spec_helper.rb'
def describe_project(name, &block)
describe name do
before(:each) do
@project = File.dirname(__FILE__) + "/../../test_data/#{name}/#{name}.xcodeproj"
@reader = XcodeprojReader::Reader.new(@project)
end
yield
end
end
describe "listing groups" do
describe_project "Default Cocoa Project" do
it "should return the number of groups" do
@reader.groups.size.should == 5
end
it "should return the groups" do
@reader.groups.should == ["Classes", "Other Sources", "Resources", "Frameworks", "Products"]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment