spec/opal/before_hooks_spec.rb in opal-rspec-0.5.0 vs spec/opal/before_hooks_spec.rb in opal-rspec-0.6.0.beta1

- old
+ new

@@ -1,5 +1,7 @@ +require 'spec_helper' + describe 'hooks' do describe 'before' do context 'async' do let(:raise_before_error) { false } before do @@ -99,85 +101,85 @@ end end end end end - + context 'sync' do context 'with sync subject' do subject { 42 } - + context 'context' do context 'success' do before :context do @@before_context_both_sync = 22 end - + before do raise "@@before_context_both_sync should already be 22!" unless @@before_context_both_sync == 22 @test_value = 42 end - - it { is_expected.to eq @test_value } + + it { is_expected.to eq @test_value } end - + context 'fails properly' do before :context do raise 'it failed in the before context!' @@before_context_both_sync = 55 end - + before do raise "we reached before:each and we should not have!" if @@before_context_both_sync == 55 end - + it 'should not reach the example' do fail 'we reached the example and we should not have!' end end end - + context 'succeeds' do before do @test_value = 42 end - + it { is_expected.to eq @test_value } end - + context 'before :each fails properly' do before do raise 'before :each failed properly' end - + it 'should not reach the example' do fail 'we reached the example and we should not have!' end end - + context 'first before :each in chain triggers failure' do before do raise 'first before :each fails, this is correct' end - + context 'inner context' do before do raise 'we reached the inner before :each and we should not have' end - + it 'should not reach the example' do fail 'we reached the example and we should not have!' end end end - + context 'match fails properly' do before do @test_value = 42 end - + it { is_expected.to_not eq @test_value } end end - end + end end end