Sha256: 3b90e42720f9cc57a913740622f1ac02b603aab6bd74946ce41f0589fdcab3eb
Contents?: true
Size: 799 Bytes
Versions: 2
Compression:
Stored size: 799 Bytes
Contents
require 'spec_helper' require 'reek/source/sexp_node' include Reek::Source describe SexpNode do context 'format' do it 'formats self' do @node = s(:self) @node.extend(SexpNode) @node.format_ruby.should == 'self' end end context 'hash' do it 'hashes equal for equal sexps' do node1 = ast(:defn, s(:const2, :Fred, :jim), s(:call, :+, s(:lit, 4), :fred)) node2 = ast(:defn, s(:const2, :Fred, :jim), s(:call, :+, s(:lit, 4), :fred)) node1.hash.should == node2.hash end it 'hashes diferent for diferent sexps' do node1 = ast(:defn, s(:const2, :Fred, :jim), s(:call, :+, s(:lit, 4), :fred)) node2 = ast(:defn, s(:const2, :Fred, :jim), s(:call, :+, s(:lit, 3), :fred)) node1.hash.should_not == node2.hash end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
reek-1.3.8 | spec/reek/source/sexp_node_spec.rb |
reek-1.3.7 | spec/reek/source/sexp_node_spec.rb |