changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/spec/spec/runner/class_and_argument_parser_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.rb'
2
3module Spec
4 module Runner
5 describe ClassAndArgumentsParser, ".parse" do
6
7 it "should use a single : to separate class names from arguments" do
8 ClassAndArgumentsParser.parse('Foo').should == ['Foo', nil]
9 ClassAndArgumentsParser.parse('Foo:arg').should == ['Foo', 'arg']
10 ClassAndArgumentsParser.parse('Foo::Bar::Zap:arg').should == ['Foo::Bar::Zap', 'arg']
11 ClassAndArgumentsParser.parse('Foo:arg1,arg2').should == ['Foo', 'arg1,arg2']
12 ClassAndArgumentsParser.parse('Foo::Bar::Zap:arg1,arg2').should == ['Foo::Bar::Zap', 'arg1,arg2']
13 ClassAndArgumentsParser.parse('Foo::Bar::Zap:drb://foo,drb://bar').should == ['Foo::Bar::Zap', 'drb://foo,drb://bar']
14 end
15
16 it "should raise an error when passed an empty string" do
17 lambda do
18 ClassAndArgumentsParser.parse('')
19 end.should raise_error("Couldn't parse \"\"")
20 end
21 end
22 end
23end