Upgraded Rails and RSpec
[monkeycharger.git] / vendor / plugins / rspec / rspec / examples / pure / io_processor_spec.rb
blob5cab7bf317301b177bb48f16464a0b78b5edfd3d
1 require File.dirname(__FILE__) + '/spec_helper'
2 require File.dirname(__FILE__) + '/io_processor'
3 require 'stringio'
5 describe "An IoProcessor" do
6   before(:each) do
7     @processor = IoProcessor.new
8   end
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
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