X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/ddd5b4cf19a92582fd114914be5bd5a04d3522a7..3f607d565bc0e2c7b1b738301c11c16d069913d5:/vendor/gems/rspec-1.1.2/spec/spec/runner/class_and_argument_parser_spec.rb diff --git a/vendor/gems/rspec-1.1.2/spec/spec/runner/class_and_argument_parser_spec.rb b/vendor/gems/rspec-1.1.2/spec/spec/runner/class_and_argument_parser_spec.rb new file mode 100644 index 000000000..b4e9e7f53 --- /dev/null +++ b/vendor/gems/rspec-1.1.2/spec/spec/runner/class_and_argument_parser_spec.rb @@ -0,0 +1,23 @@ +require File.dirname(__FILE__) + '/../../spec_helper.rb' + +module Spec + module Runner + describe ClassAndArgumentsParser, ".parse" do + + it "should use a single : to separate class names from arguments" do + ClassAndArgumentsParser.parse('Foo').should == ['Foo', nil] + ClassAndArgumentsParser.parse('Foo:arg').should == ['Foo', 'arg'] + ClassAndArgumentsParser.parse('Foo::Bar::Zap:arg').should == ['Foo::Bar::Zap', 'arg'] + ClassAndArgumentsParser.parse('Foo:arg1,arg2').should == ['Foo', 'arg1,arg2'] + ClassAndArgumentsParser.parse('Foo::Bar::Zap:arg1,arg2').should == ['Foo::Bar::Zap', 'arg1,arg2'] + ClassAndArgumentsParser.parse('Foo::Bar::Zap:drb://foo,drb://bar').should == ['Foo::Bar::Zap', 'drb://foo,drb://bar'] + end + + it "should raise an error when passed an empty string" do + lambda do + ClassAndArgumentsParser.parse('') + end.should raise_error("Couldn't parse \"\"") + end + end + end +end