Sha256: e6c702cf35cba9cf6ac9c36f4d7da7e2112aa34c57de56e1332e0e3ebfa337ad

Contents?: true

Size: 1.39 KB

Versions: 9

Compression:

Stored size: 1.39 KB

Contents

require File.dirname(__FILE__) + "/../../../spec_helper"

module Spec
  module Example
    # NoMethodError: undefined method `subclass' if constant is used below
    # instead of string
    describe "ExampleGroupMethods" do
      before(:each) do
        $show_deep_test_all_block_warning = true
      end

      it_should_behave_like "sandboxed rspec_options"
      
      [:append_before, :before, :after, :prepend_before, :append_after, :prepend_after].each do |rspec_method|
        it "should print warning on first call to #{rspec_method}(:all)" do
          out = capture_stderr do
            describe("test") do
              send(rspec_method, :all) {}
              send(rspec_method, :all) {}
            end
          end

          out.should == ExampleGroupMethods::DeepTestAllBlockWarning + "\n"
        end

        it "#{rspec_method}(:all) should not print warning if global setting is turned off" do
          $show_deep_test_all_block_warning = false
          
          out = capture_stderr do
            describe("test") do
              send(rspec_method, :all) {}
            end
          end

          out.should == ""
        end
        
        it "should not raise error on #{rspec_method}(:each)" do
          lambda {
            describe("test") do
              send(rspec_method, :each) {}
            end
          }.should_not raise_error
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
jperkins-deep_test-1.2.2 spec/deep_test/spec/extensions/example_group_methods_spec.rb
jstorimer-deep-test-2.0.0 spec/deep_test/spec/extensions/example_group_methods_spec.rb
jstorimer-deep-test-1.4.0 spec/deep_test/spec/extensions/example_group_methods_spec.rb
jstorimer-deep-test-1.3.0 spec/deep_test/spec/extensions/example_group_methods_spec.rb
jstorimer-deep-test-1.2.0 spec/deep_test/spec/extensions/example_group_methods_spec.rb
jstorimer-deep-test-1.1.0 spec/deep_test/spec/extensions/example_group_methods_spec.rb
jstorimer-deep-test-1.0.0 spec/deep_test/spec/extensions/example_group_methods_spec.rb
jstorimer-deep-test-0.2.0 spec/deep_test/spec/extensions/example_group_methods_spec.rb
jstorimer-deep-test-0.1.0 spec/deep_test/spec/extensions/example_group_methods_spec.rb