Sha256: 15eddf2d4e5b7aa48356459a22266763c8b06d389e0751f5975edc4c0e2c62bb

Contents?: true

Size: 1.23 KB

Versions: 2

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'
require 'lucid/interface_rb/rb_language'

module Lucid
  describe 'Pending' do
    before(:each) do
      l = InterfaceRb::RbLanguage.new(Runtime.new)
      l.begin_rb_scenario(double('scenario').as_null_object)
      @domain= l.current_domain
    end

    it 'should raise a Pending if no block is supplied' do
      lambda {
        @domain.pending 'TODO'
      }.should raise_error(Lucid::Pending, /TODO/)
    end

    it 'should raise a Pending if a supplied block fails as expected' do
      lambda {
        @domain.pending 'TODO' do
          raise 'that is a problem'
        end
      }.should raise_error(Lucid::Pending, /TODO/)
    end

    it 'should raise a Pending if a supplied block fails as expected with a double' do
      lambda {
        @domain.pending 'TODO' do
          m = double('test')
          m.should_receive(:testing)
          RSpec::Mocks.verify
        end
      }.should raise_error(Lucid::Pending, /TODO/)
    end

    it 'should raise a Pending if a supplied block starts working' do
      lambda {
        @domain.pending 'TODO' do
          # Nothing happens here.
        end
      }.should raise_error(Lucid::Pending, /TODO/)
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lucid-0.3.3 spec/lucid/pending_spec.rb
lucid-0.3.0 spec/lucid/pending_spec.rb