Sha256: d3dadc595cdb32d291524825feb9f25b6056165047f85f3108a10de71ba9ced9

Contents?: true

Size: 803 Bytes

Versions: 3

Compression:

Stored size: 803 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

3 entries across 3 versions & 1 rubygems

Version Path
cypher_builder-0.0.3 spec/cypher_builder/node_spec.rb
cypher_builder-0.0.2 spec/cypher_builder/node_spec.rb
cypher_builder-0.0.1 spec/cypher_builder/node_spec.rb