spec/rflow_configuration_spec.rb in rflow-0.0.5 vs spec/rflow_configuration_spec.rb in rflow-1.0.0a1

- old
+ new

@@ -7,11 +7,11 @@ before(:each) do # RFlow::Configuration.available_data_types.clear # RFlow::Configuration.available_data_extensions.clear end - + describe '.add_available_data_type' do context 'if passed a data_serialization that is not avro or xml' do it "should throw an exception" do expect do RFlow::Configuration.add_available_data_type('A', 'boom', 'schema') @@ -25,30 +25,30 @@ end end end describe "Data Extensions" do - + describe ".add_available_data_extension" do context 'if passed a non-module data extension' do it "should throw an exception" do expect do RFlow::Configuration.add_available_data_extension('data_type', 'not a Module') end.to raise_error(ArgumentError) end end - + context "if passed a valid Module as a data extension" do it "should update the available_data_extensions" do num_extensions = RFlow::Configuration.available_data_extensions['data_type'].size expect do RFlow::Configuration.add_available_data_extension('data_type', Module.new) end.to_not raise_error RFlow::Configuration.available_data_extensions['data_type'].should have(num_extensions+1).items end end end - + it "should perform simple 'prefix'-based inheritance for extensions" do RFlow::Configuration.add_available_data_extension('A', A = Module.new) RFlow::Configuration.add_available_data_extension('A::B', B = Module.new) RFlow::Configuration.add_available_data_extension('A::B::C', C = Module.new) RFlow::Configuration.add_available_data_extension('A::B::C::D', D = Module.new)