Sha256: 94e7bc27aa061acf6d9afbb226f24d4a6ac21fbda6aacd7e364e674cd15a4fa3

Contents?: true

Size: 698 Bytes

Versions: 2

Compression:

Stored size: 698 Bytes

Contents

require 'spec_helper'

describe "should raise_error" do
  
  before(:each) do
    @expected_matcher = {'matchers' => {'raise_error' => 'mostrar_erro'}}
    portuguese_language(@expected_matcher)
    Spec::Matchers.register_all_matchers
  end
  
  it 'should register the methods for the value equal matcher' do
    values = @expected_matcher['matchers']['raise_error'].split('|') 
    values.each { |method_name| Object.instance_methods.should be_include(method_name) }
  end
  
  it "should pass if anything is raised" do
    lambda {raise}.should mostrar_erro
  end
  
  it "should fail if nothing is raised" do
    lambda {
      lambda {}.should mostrar_erro
    }.should mostrar_erro
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspec-i18n-1.1.0 spec/spec-i18n/matchers/raise_error_spec.rb
rspec-i18n-1.0.0 spec/spec-i18n/matchers/raise_error_spec.rb