Sha256: d66b74e3ed8c4349dbbe350561808955e621bfb906aca8e80e7cacf42ced7561

Contents?: true

Size: 678 Bytes

Versions: 7

Compression:

Stored size: 678 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe SQL::Generator::Relation, '#name' do
  subject { object.name }

  let(:described_class) { Class.new(SQL::Generator::Relation) }
  let(:object)          { described_class.new                 }

  context 'when name is nil' do
    it_should_behave_like 'an idempotent method'

    it { should be_nil }
  end

  context 'when name is set' do
    let(:name) { 'test' }

    before do
      # subclasses set @name, but nothing in this class
      # does does so simulate it being set
      object.instance_variable_set(:@name, name)
    end

    it_should_behave_like 'an idempotent method'

    it { should equal(name) }
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
axiom-sql-generator-0.2.0 spec/unit/axiom/sql/generator/relation/name_spec.rb
axiom-sql-generator-0.1.0 spec/unit/axiom/sql/generator/relation/name_spec.rb
veritas-sql-generator-0.0.7 spec/unit/veritas/sql/generator/relation/name_spec.rb
veritas-sql-generator-0.0.6 spec/unit/veritas/sql/generator/relation/name_spec.rb
veritas-sql-generator-0.0.5 spec/unit/veritas/sql/generator/relation/name_spec.rb
veritas-sql-generator-0.0.4 spec/unit/veritas/sql/generator/relation/name_spec.rb
veritas-sql-generator-0.0.3 spec/unit/veritas/sql/generator/relation/name_spec.rb