Sha256: 3f582b18164a38158297c99f476c53de606d2ae14beedb5b4d0e8b9f94157ed4

Contents?: true

Size: 938 Bytes

Versions: 1

Compression:

Stored size: 938 Bytes

Contents

require 'spec_helper'

describe 'new', Sandbox::Error do
  it "should wrap it's message with 'Sandbox error'" do
    Sandbox::Error.new( 'msg' ).message.should == 'Sandbox error: msg'
  end
end

describe 'new', Sandbox::LoadedSandboxError do
  it "should have informative default msg" do
    Sandbox::LoadedSandboxError.new.message.should =~ /loaded sandbox/
  end
end

describe 'new', Sandbox::ParseError do
  it "should accept reason with array" do
    Sandbox::ParseError.new( 'testing', [ 1, 2, 3, 4 ] ).
        message.should =~ /testing => 1 2 3 4/
  end

  it "should accept reason with string" do
    Sandbox::ParseError.new( 'testing', "1, 2, 3, 4" ).
        message.should =~ /testing => 1, 2, 3, 4/
  end

  it "should fall back to reason alone" do
    Sandbox::ParseError.new( 'testing', [] ).
        message.should =~ /testing$/
    Sandbox::ParseError.new( 'testing', '' ).
        message.should =~ /testing$/
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-virtualenv-0.5.0 spec/sandbox/errors_spec.rb