Sha256: a6d618c388ca6890cec72ad56ffdd68cfda72cd790c75147e5b7c6c4c1ef2a6d
Contents?: true
Size: 821 Bytes
Versions: 8
Compression:
Stored size: 821 Bytes
Contents
require_relative '../../spec_helper' require_relative '../../../lib/reek/ast/node' RSpec.describe Reek::AST::Node do context 'format' do it 'formats self' do @node = s(:self) expect(@node.format_to_ruby).to eq('self') end end context 'hash' do it 'hashes equal for equal sexps' do node1 = s(:def, :jim, s(:args), s(:send, s(:int, 4), :+, s(:send, nil, :fred))) node2 = s(:def, :jim, s(:args), s(:send, s(:int, 4), :+, s(:send, nil, :fred))) expect(node1.hash).to eq(node2.hash) end it 'hashes diferent for diferent sexps' do node1 = s(:def, :jim, s(:args), s(:send, s(:int, 4), :+, s(:send, nil, :fred))) node2 = s(:def, :jim, s(:args), s(:send, s(:int, 3), :+, s(:send, nil, :fred))) expect(node1.hash).not_to eq(node2.hash) end end end
Version data entries
8 entries across 8 versions & 1 rubygems