Sha256: ce8fe16a8b8f9851276ac9ed8949b06a6749c46c4a89231393bcf6edc76dd890

Contents?: true

Size: 791 Bytes

Versions: 6

Compression:

Stored size: 791 Bytes

Contents

require 'test_helper'

module Vedeu

  module Logging

    describe Debug do

      let(:described) { Vedeu::Logging::Debug }

      before do
        File.stubs(:open).with('/tmp/profile.html', 'w').returns(:some_code)
      end

      describe '.profile' do
        let(:filename)  { 'profile.html' }
        let(:some_code) { :some_code }

        context 'when the block is not given' do
          subject { described.profile(filename) }

          it { subject.must_equal(nil) }
        end

        context 'when the block is given' do
          subject { described.profile(filename) { some_code } }

          it do
            ::File.expects(:open).with('/tmp/profile.html', 'w')
            subject
          end
        end
      end

    end # Debug

  end # Logging

end # Vedeu

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vedeu-0.8.0 test/lib/vedeu/logging/debug_test.rb
vedeu-0.7.4 test/lib/vedeu/logging/debug_test.rb
vedeu-0.7.3 test/lib/vedeu/logging/debug_test.rb
vedeu-0.7.2 test/lib/vedeu/logging/debug_test.rb
vedeu-0.7.1 test/lib/vedeu/logging/debug_test.rb
vedeu-0.7.0 test/lib/vedeu/logging/debug_test.rb