1 require File.dirname(__FILE__) + '/../../spec_helper.rb'
5 describe ClassAndArgumentsParser, ".parse" do
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']
16 it "should raise an error when passed an empty string" do
18 ClassAndArgumentsParser.parse('')
19 end.should raise_error("Couldn't parse \"\"")