Sha256: 884139cc1c3d04a60e171374ab949b75600ae21fbb12666057c8faf6c2273c87

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

# Copyright (C) 2011  Miho SUZUKI
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
require 'logaling'

require "fileutils"
require 'stringio'

LOGALING_HOME = File.expand_path("~/.logaling.d")

RSpec.configure do |config|
  def capture(stream)
    begin
      stream = stream.to_s
      eval "$#{stream} = StringIO.new"
      yield
      result = eval("$#{stream}").string
    ensure
      eval("$#{stream} = #{stream.upcase}")
    end

    result
  end

  alias :silence :capture
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
logaling-command-0.1.2 spec/spec_helper.rb
logaling-command-0.1.1 spec/spec_helper.rb
logaling-command-0.1.0 spec/spec_helper.rb