Sha256: f1b1dd53605d8b4ec5450be2215aec1774ae7a984874a885d08479cfe3256988

Contents?: true

Size: 506 Bytes

Versions: 10

Compression:

Stored size: 506 Bytes

Contents

require 'spec_helper'

class Paper
  include CanTango::Helpers::Debug
end

module Writer
  def self.global_buffer
     @global_buffer ||= ""
   end
 end

describe CanTango::Helpers::Debug do
  before do
    @paper = Paper.new
    @paper.debug_writer = lambda {|m| Writer.global_buffer << m }
    @paper.do_debug = true
  end

  subject { @paper }
  
  describe 'should write to writer' do
    before do
      @paper.debug 'hello'
    end
    
    specify { Writer.global_buffer.should == 'hello'}
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cantango-core-0.1.9.3 spec/cantango/helpers/debug_spec.rb
cantango-core-0.1.9.2 spec/cantango/helpers/debug_spec.rb
cantango-core-0.1.9.1 spec/cantango/helpers/debug_spec.rb
cantango-core-0.1.9 spec/cantango/helpers/debug_spec.rb
cantango-core-0.1.8 spec/cantango/helpers/debug_spec.rb
cantango-core-0.1.7 spec/cantango/helpers/debug_spec.rb
cantango-core-0.1.6 spec/cantango/helpers/debug_spec.rb
cantango-core-0.1.5 spec/cantango/helpers/debug_spec.rb
cantango-core-0.1.4 spec/cantango/helpers/debug_spec.rb
cantango-core-0.1.3 spec/cantango/helpers/debug_spec.rb