changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/examples/pure/io_processor_spec.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1require File.dirname(__FILE__) + '/spec_helper'
2require File.dirname(__FILE__) + '/io_processor'
3require 'stringio'
4
5describe "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
21end