]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/rspec-1.1.2/examples/pure/io_processor_spec.rb
5cab7bf317301b177bb48f16464a0b78b5edfd3d
[rails.git] / vendor / gems / rspec-1.1.2 / examples / pure / io_processor_spec.rb
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