Sha256: 6337ae546f7d3d57e58d2b5233dbf109fe61cb6c5bb2cc00e7db138b13f7d741

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require File.expand_path('../../../spec_helper', __FILE__)

describe 'have_public_method_defined matcher' do
  before(:all) do
    @exception = RSpec::Expectations::ExpectationNotMetError
  end

  describe 'with should' do
    it 'should pass when the method is defined' do
      running = lambda { String.should have_public_method_defined(:length) }
      running.should_not raise_error(@exception)
    end

    it 'should fail when the method is not defined' do
      running = lambda { String.should have_public_method_defined(:__invalid__) }
      running.should raise_error(@exception)
    end
  end

  describe 'with should_not' do
    it 'should fail when the method is defined' do
      running = lambda { String.should_not have_public_method_defined(:length) }
      running.should raise_error(@exception)
    end

    it 'should pass when the method is not defined' do
      running = lambda { String.should_not have_public_method_defined(:__invalid__) }
      running.should_not raise_error(@exception)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
montage-0.4.0 spec/montage/spec/have_public_method_defined_spec.rb