Sha256: 8cf19a8d1b80435e6eb146f6928842767c50fc9cc7b8c1fd2342992a42781104

Contents?: true

Size: 1.67 KB

Versions: 38

Compression:

Stored size: 1.67 KB

Contents

module Spec
  module Example
    describe Pending do
      
      context "when no block is supplied" do
        it "raises an ExamplePendingError if no block is supplied" do
          lambda {
            pending "TODO"
          }.should raise_error(ExamplePendingError, /TODO/)
        end
      end
      
      context "when the supplied block fails" do
        it "raises an ExamplePendingError if a supplied block fails as expected" do
          lambda {
            pending "TODO" do
              raise "oops"
            end
          }.should raise_error(ExamplePendingError, /TODO/)
        end
      end
      
      context "when the supplied block fails with a mock" do
        it "raises an ExamplePendingError if a supplied block fails as expected with a mock" do
          lambda {
            pending "TODO" do
              m = mock("thing")
              m.should_receive(:foo)
              m.rspec_verify
            end
          }.should raise_error(ExamplePendingError, /TODO/)
        end
      end
      
      context "when the supplied block passes" do
        it "raises a PendingExampleFixedError" do
          lambda {
            pending "TODO" do
              # success!
            end
          }.should raise_error(PendingExampleFixedError, /TODO/)
        end
      end
    end
    
    describe ExamplePendingError do
      it "should have the message provided" do
        ExamplePendingError.new("a message").message.should == "a message"
      end
    end
    
    describe NotYetImplementedError do
      it "should have the message 'Not Yet Implemented'" do
        NotYetImplementedError.new.message.should == "Not Yet Implemented"
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 11 rubygems

Version Path
rspec-instructure-1.3.3 spec/spec/example/pending_module_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/spec/spec/example/pending_module_spec.rb
rspec-1.3.2 spec/spec/example/pending_module_spec.rb
rspec-1.3.1 spec/spec/example/pending_module_spec.rb
rspec-1.3.1.rc spec/spec/example/pending_module_spec.rb
rspec-1.3.0 spec/spec/example/pending_module_spec.rb
hubbub-0.0.11 lib/vendor/plugins/rspec/spec/spec/example/pending_module_spec.rb
hubbub-0.0.10 lib/vendor/plugins/rspec/spec/spec/example/pending_module_spec.rb
hubbub-0.0.9 lib/vendor/plugins/rspec/spec/spec/example/pending_module_spec.rb
hubbub-0.0.8 lib/vendor/plugins/rspec/spec/spec/example/pending_module_spec.rb
hubbub-0.0.6 lib/vendor/plugins/rspec/spec/spec/example/pending_module_spec.rb
simple-templater-0.0.1.4 gems/gems/rspec-1.2.9/spec/spec/example/pending_module_spec.rb
media-path-0.1.2 vendor/rspec/spec/spec/example/pending_module_spec.rb
simple-templater-0.0.1.3 vendor/rspec/spec/spec/example/pending_module_spec.rb
pupu-0.0.2.pre vendor/rspec/spec/spec/example/pending_module_spec.rb
media-path-0.1.1.pre vendor/rspec/spec/spec/example/pending_module_spec.rb
simple-templater-0.0.1.2 vendor/rspec/spec/spec/example/pending_module_spec.rb
media-path-0.1.1 vendor/rspec/spec/spec/example/pending_module_spec.rb
simple-templater-0.0.1.1 vendor/rspec/spec/spec/example/pending_module_spec.rb
pupu-0.0.2 vendor/rspec/spec/spec/example/pending_module_spec.rb