Sha256: dd1af6feb15929f55560d59cb2b0b448cefcd0e41bb232306afdd9b8f8c1ebf8
Contents?: true
Size: 825 Bytes
Versions: 2
Compression:
Stored size: 825 Bytes
Contents
# encoding: utf-8 require 'spec_helper' module Rubocop module Cop module Style describe UnlessElse do subject(:ue) { UnlessElse.new } it 'registers an offence for an unless with else' do inspect_source(ue, ['unless x', ' a = 1', 'else', ' a = 0', 'end']) expect(ue.messages).to eq( ['Never use unless with else. Rewrite these with the ' + 'positive case first.']) end it 'accepts an unless without else' do inspect_source(ue, ['unless x', ' a = 1', 'end']) expect(ue.messages).to be_empty end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubocop-0.13.1 | spec/rubocop/cop/style/unless_else_spec.rb |
rubocop-0.13.0 | spec/rubocop/cop/style/unless_else_spec.rb |