Sha256: 61cfa9548108c92408d1e3fbfb233f0058896945a7a009e124e3d7021046f70f

Contents?: true

Size: 673 Bytes

Versions: 5

Compression:

Stored size: 673 Bytes

Contents

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

include Fixtures

describe Nitpick::MethodNitpicker do
  it "should create a warning for an empty method" do
    nitpicker = Nitpick::MethodNitpicker.new(MethodBadness, :empty_method)
    nitpicker.nitpick!
    nitpicker.warnings.include?(Nitpick::Warnings::EmptyMethod.new(:empty_method)).should be_true
  end
  
  it "should not create a empty method warning for a non empty method" do
    nitpicker = Nitpick::MethodNitpicker.new(MethodBadness, :non_empty_method)
    nitpicker.nitpick!
    nitpicker.warnings.any? {|w| w.is_a? Nitpick::Warnings::EmptyMethod }.should be_false
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

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