kevinclark / dust

Lint for Ruby. Moved to http://wiki.github.com/kevinclark/nitpick/

dust / spec / useless_branch_spec.rb
100644 11 lines (9 sloc) 0.337 kb
1
2
3
4
5
6
7
8
9
10
11
require File.dirname(__FILE__) + '/spec_helper'
require 'fixtures/branch_badness'
 
include Fixtures
 
describe Dust::Warnings::UselessBranch do
  it "should match against branches returning only true and false" do
    warning = Dust::Warnings::UselessBranch.new(s(:cond), s(:true), s(:false))
    warning.matches?.should be_true
  end
end