1 require File.dirname(__FILE__) + '/../../spec_helper.rb'
4 def initialize exists, description
6 @description = description
17 include Spec::Matchers
18 def initialize substance
19 @substance = substance
22 @substance.should exist
26 describe "should exist," do
29 @real = Substance.new true, 'something real'
30 @imaginary = Substance.new false, 'something imaginary'
33 describe "within an example group" do
35 it "should pass if target exists" do
39 it "should fail if target does not exist" do
40 lambda { @imaginary.should exist }.should fail
43 it "should pass if target doesn't exist" do
44 lambda { @real.should_not exist }.should fail
48 describe "outside of an example group" do
50 it "should pass if target exists" do
51 real_tester = SubstanceTester.new @real
52 real_tester.should_exist