Sha256: 88e44cc1a8210482e6c09c84e2c8de8ae675f0faf3c27e675b6011964894dd51
Contents?: true
Size: 974 Bytes
Versions: 19
Compression:
Stored size: 974 Bytes
Contents
require File.join(File.dirname(__FILE__),'../../spec_helper') share_examples_for "an object that manages paths" do before do @path_manager.add_path :testing, '/testing' @path_manager.add_path :first, '/1' end it 'returns a string when given a string' do @path_manager.path_to('hi').should == 'hi' end it 'returns a path when given a registered symbol' do @path_manager.path_to(:testing).should == '/testing' end it 'raises an error when given a unregistered symbol' do lambda { @path_manager.path_to(:foobar) }.should raise_error(IMW::PathError) end it 'returns a constructed path when passed a mixture of symbols, strings, and arrays ' do @path_manager.path_to( [:testing, 'hi'], [[['there']]]).should == '/testing/hi/there' end it 'will correctly expand paths themselves defined via symbols' do @path_manager.add_path(:first, :testing, '1') @path_manager.path_to(:first).should == '/testing/1' end end
Version data entries
19 entries across 19 versions & 1 rubygems