Sha256: f393eda20a0724e08e1d2f242ca807f21c64f4ff73ac7a9dc10d5d79fe331059

Contents?: true

Size: 639 Bytes

Versions: 7

Compression:

Stored size: 639 Bytes

Contents

require File.join(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__)))), 'spec_helper')
require File.join(File.dirname(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__))))), 'lib', 'reek', 'source', 'sexp_formatter')

include Reek::Source

describe SexpFormatter do
  describe "::format" do
    it 'formats a simple s-expression' do
      result = SexpFormatter.format s(:lvar, :foo)
      result.should == "foo"
    end

    it 'formats a more complex s-expression' do
      result = SexpFormatter.format s(:call, nil, :foo, s(:arglist, s(:lvar, :bar)))
      result.should == "foo(bar)"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
reek-1.3.1 spec/reek/source/sexp_formatter_spec.rb
reek-1.3 spec/reek/source/sexp_formatter_spec.rb
reek-1.2.13 spec/reek/source/sexp_formatter_spec.rb
reek-1.2.12 spec/reek/source/sexp_formatter_spec.rb
reek-1.2.11 spec/reek/source/sexp_formatter_spec.rb
reek-1.2.10 spec/reek/source/sexp_formatter_spec.rb
reek-1.2.9 spec/reek/source/sexp_formatter_spec.rb