require File.dirname(__FILE__) + '/../spec_helper.rb' describe Capture do it "should be blank when just created" do Capture.create.contents.should == '' end it "should append data to existing" do capture = Capture.create data1 = 'hello' data2 = 'world' capture.append(data1) capture.contents.should == data1 capture.append(data2) capture.contents.should == data1 + data2 end it "can clear its data" do capture = Capture.create capture.append('hello world') capture.clear! capture.contents.should == '' end end