Sha256: f2ed5643b14d77a706d6e71d0796b118375ce3c2ac5605ec3ba42d1aa04522c1

Contents?: true

Size: 809 Bytes

Versions: 2

Compression:

Stored size: 809 Bytes

Contents

require 'spec_helper'

describe Node do
  let(:node) { Node('x', labels: 'uga') }

  describe '#as_cypher' do
    let(:node_prefix_only) { Node('x') }
    let(:node_multiple_labels) { Node('x', labels: ['uga', 'buga']) }

    it 'converts to be used in "match"' do
      expect(node.as_cypher).to eq '(x:uga)'
      expect(node_prefix_only.as_cypher).to eq '(x)'
      expect(node_multiple_labels.as_cypher).to eq '(x:uga:buga)'
    end
  end

  describe '#respond_to?' do
    it 'is true for #as_cypher' do
      expect(node.respond_to?(:as_cypher)).to be_truthy
    end
    it 'is true for any method' do
      expect(node.respond_to?(:anything)).to be_truthy
    end
  end

  describe 'any method' do
    it 'responds with a Field' do
      expect(node.some_field).to be_instance_of Field
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cypher_builder-0.0.5 spec/cypher_builder/node_spec.rb
cypher_builder-0.0.4 spec/cypher_builder/node_spec.rb