Sha256: 1a4628f8e9d8a7d2d230bd7fc37f756d5eb3df46ccee733fae14581d66c0cebc
Contents?: true
Size: 912 Bytes
Versions: 3
Compression:
Stored size: 912 Bytes
Contents
require "rspec" require "clamp" require "stringio" RSpec.configure do |config| config.mock_with :rr config.around(:each) do |example| begin example.run rescue SystemExit => e fail "Unexpected exit with status #{e.status}" end end end module OutputCapture def self.included(target) target.before do $stdout = @out = StringIO.new $stderr = @err = StringIO.new end target.after do $stdout = STDOUT $stderr = STDERR end end def stdout @out.string end def stderr @err.string end end module CommandFactory def given_command(name, &block) let(:command_class) do Class.new(Clamp::Command, &block) end let(:command) do command_class.new(name) end end end module SetEnv def set_env(name, value) if value ENV[name] = value else ENV.delete(name) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
clamp-1.2.1 | spec/spec_helper.rb |
clamp-1.2.0 | spec/spec_helper.rb |
clamp-1.2.0.beta1 | spec/spec_helper.rb |