Sha256: 98098e67cad36144742ceead181957a8efe5ca8098ff979482199656939365c8
Contents?: true
Size: 600 Bytes
Versions: 13
Compression:
Stored size: 600 Bytes
Contents
# encoding: utf-8 require 'spec_helper' module Rubocop module Cop describe SingleLineBlocks do let(:blocks) { SingleLineBlocks.new } it 'registers an offence for a single line block with do-end' do inspect_source(blocks, '', ['each do |x| end']) expect(blocks.offences.map(&:message)).to eq( ['Prefer {...} over do...end for single-line blocks.']) end it 'accepts a single line block with braces' do inspect_source(blocks, '', ['each { |x| }']) expect(blocks.offences.map(&:message)).to be_empty end end end end
Version data entries
13 entries across 13 versions & 1 rubygems