Skip to content

Instantly share code, notes, and snippets.

@patmaddox
Created April 19, 2009 08:03
Show Gist options
  • Save patmaddox/97967 to your computer and use it in GitHub Desktop.
Save patmaddox/97967 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'spec'
class MyExampleGroup < Spec::Example::ExampleGroup
before(:each) do
puts "in before(:each)"
my_custom_method
end
def my_custom_method
puts "hello from a custom example group"
end
Spec::Example::ExampleGroupFactory.register :mine, self
end
describe "custom example group", :type => :mine do
it "should do something sweet" do
puts "in an example"
end
end
require 'rubygems'
require 'spec'
module Spec
module Matchers
def equal_my_foo
Matcher.new :equal_my_foo, @foo do |expected|
match do |actual|
actual.should == expected
end
end
end
end
end
describe "matcher" do
it "should have access to an instance variable" do
@foo = :bar
:bar.should equal_my_foo
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment