~ubuntu-branches/ubuntu/oneiric/puppet/oneiric-security

« back to all changes in this revision

Viewing changes to vendor/gems/rspec/examples/pure/io_processor_spec.rb

  • Committer: Bazaar Package Importer
  • Author(s): Micah Anderson
  • Date: 2008-07-26 15:43:45 UTC
  • mto: (3.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20080726154345-1fmgo76b4l72ulvc
ImportĀ upstreamĀ versionĀ 0.24.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require File.dirname(__FILE__) + '/spec_helper'
 
2
require File.dirname(__FILE__) + '/io_processor'
 
3
require 'stringio'
 
4
 
 
5
describe "An IoProcessor" do
 
6
  before(:each) do
 
7
    @processor = IoProcessor.new
 
8
  end
 
9
 
 
10
  it "should raise nothing when the file is exactly 32 bytes" do
 
11
    lambda {
 
12
      @processor.process(StringIO.new("z"*32))
 
13
    }.should_not raise_error
 
14
  end
 
15
 
 
16
  it "should raise an exception when the file length is less than 32 bytes" do
 
17
    lambda {
 
18
      @processor.process(StringIO.new("z"*31))
 
19
    }.should raise_error(DataTooShort)
 
20
  end
 
21
end