Sha256: 321644c967abf8920244a6a0d6ca9c5c716c632163be284c6b34288967a986e0

Contents?: true

Size: 618 Bytes

Versions: 2

Compression:

Stored size: 618 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper.rb'

require 'reek/method_checker'
require 'reek/smells'
require 'reek/report'

include Reek

def render(source)
  sexp = Checker.parse_tree_for(source)[0]
  Printer.print(sexp)
end

describe Printer do
  it 'should format a simple constant' do
    render('Alpha').should == 'Alpha'
  end

  it 'should format "::" correctly' do
    render('Alpha::Beta').should == 'Alpha::Beta'
  end

  it 'should format class variables correctly' do
    render('@@fred').should == '@@fred'
  end

  it 'should format xstr correctly' do
    render('`ls`').should == '`ls`'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
reek-0.2.3 spec/reek/printer_spec.rb
reek-0.3.0 spec/reek/printer_spec.rb