Sha256: 29aad298cfa5de37fa2fe546ca97b9cc96cbbd17dafde11ce4183a92245e1b33

Contents?: true

Size: 856 Bytes

Versions: 5

Compression:

Stored size: 856 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'
require 'fixtures/rescue_badness'

include Fixtures

describe Nitpick::RescueNitpicker do
  it "should create a warning for rescuing to a value" do
    nitpicker = Nitpick::RescueNitpicker.new(RescueBadness, :rescue_nil)
    nitpicker.nitpick!
    nitpicker.warnings.should == [Nitpick::Warnings::RescueValue.new]
  end
  
  it "should create a warning for rescuing Exception" do
    nitpicker = Nitpick::RescueNitpicker.new(RescueBadness, :rescue_exception)
    nitpicker.nitpick!
    nitpicker.warnings.should == [Nitpick::Warnings::RescueEverything.new]
  end
  
  it "should create a warning for rescuing Object" do
    nitpicker = Nitpick::RescueNitpicker.new(RescueBadness, :rescue_object)
    nitpicker.nitpick!
    nitpicker.warnings.should == [Nitpick::Warnings::RescueEverything.new]
  end
   
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
kevinclark-nitpick-1.0.0 spec/rescue_nitpicker_spec.rb
kevinclark-nitpick-1.0.1 spec/rescue_nitpicker_spec.rb
nitpick-1.0.0 spec/rescue_nitpicker_spec.rb
nitpick-1.0.1 spec/rescue_nitpicker_spec.rb
nitpick-1.0.2 spec/rescue_nitpicker_spec.rb