spec/em_metadata_spec.rb in amqp-spec-0.3.2 vs spec/em_metadata_spec.rb in amqp-spec-0.3.3

- old
+ new

@@ -20,14 +20,16 @@ end context 'inside nested example group 1' do nested_metadata = metadata - it 'nested group metadata CONTAINS root enclosing group metadata' do - nested_metadata.should_not == root_metadata - nested_metadata[:example_group][:example_group].should == - root_metadata[:example_group] + if rspec2? #describes RSpec2-specific behavior + it 'nested group metadata CONTAINS root enclosing group metadata' do + nested_metadata.should_not == root_metadata + nested_metadata[:example_group][:example_group].should == + root_metadata[:example_group] + end end it 'except for :example_group key, nested and root group metadata is the same' do @root = root_metadata.dup @root.delete(:example_group) @@ -52,17 +54,19 @@ end context 'inside deeply nested example group 1' do deeply_nested_metadata = metadata - it 'deeply_nested group metadata CONTAINS enclosing group metadata' do - deeply_nested_metadata.should_not == root_metadata - deeply_nested_metadata[:example_group][:example_group].should == - nested_metadata[:example_group] + if rspec2? #describes RSpec2-specific behavior + it 'deeply_nested group metadata CONTAINS enclosing group metadata' do + deeply_nested_metadata.should_not == root_metadata + deeply_nested_metadata[:example_group][:example_group].should == + nested_metadata[:example_group] + end end - it 'except for :example_group key, deeply_nested and root group metadata is the same' do + it 'except for :example_group, deeply_nested and root group metadata is the same' do @root = root_metadata.dup @root.delete(:example_group) @nested = nested_metadata.dup @nested.delete(:example_group) @deeply_nested = deeply_nested_metadata.dup @@ -83,22 +87,23 @@ it 'changing example metadata has no effect on subsequent examples' do metadata.should_not have_key :example_key metadata.should == deeply_nested_metadata end - - end + end # inside deeply nested example group 1 end # inside nested example group 1 context 'inside nested example group 2' do metadata[:nested_key] = :nested_value nested_metadata = metadata - it 'nested group metadata CONTAINS root enclosing group metadata' do - nested_metadata.should_not == root_metadata - nested_metadata[:example_group][:example_group].should == - root_metadata[:example_group] + if rspec2? #describes RSpec2-specific behavior + it 'nested group metadata CONTAINS root enclosing group metadata' do + nested_metadata.should_not == root_metadata + nested_metadata[:example_group][:example_group].should == + root_metadata[:example_group] + end end it "except for :example_group and modified keys," + "nested and root group metadata is the same" do @root = root_metadata.dup @@ -122,17 +127,19 @@ it 'changing example metadata has no effect on subsequent examples' do metadata.should_not have_key :example_key metadata.should == nested_metadata end - context 'inside deeply nested example group 1' do + context 'inside deeply nested example group 2' do metadata[:deeply_nested_key] = :deeply_nested_value deeply_nested_metadata = metadata - it 'deeply_nested group metadata CONTAINS enclosing group metadata' do - deeply_nested_metadata[:example_group][:example_group].should == - nested_metadata[:example_group] + if rspec2? #describes RSpec2-specific behavior + it 'deeply_nested group metadata CONTAINS enclosing group metadata' do + deeply_nested_metadata[:example_group][:example_group].should == + nested_metadata[:example_group] + end end it "except for :example_group and modified keys," + "deeply nested and root group metadata is the same" do @root = root_metadata.dup @@ -159,9 +166,8 @@ it 'changing example metadata has no effect on subsequent examples' do metadata.should_not have_key :example_key metadata.should == deeply_nested_metadata end - end + end # inside deeply nested example group 2 end # inside nested example group 2 - end # describe AMQP, "metadata"