Created
April 19, 2009 08:03
-
-
Save patmaddox/97967 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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