Sha256: 0db7b31a07403c9dde15fad41a86a5805db64dea4c0e8b00e30c812863f0c39f

Contents?: true

Size: 638 Bytes

Versions: 1

Compression:

Stored size: 638 Bytes

Contents

require 'spec_helper'

describe 'PGit::Helpers::QueryMethods' do
  describe '#defaulted_attrs' do
    it 'should ensure that the class has the given attributes' do
      class SomeFakeClass
        include PGit::Helpers::QueryMethods
        extend PGit::Helpers::QueryMethods

        attr_accessor :some_query, :some_other_query
        attr_query :some_query, :some_other_query

        def initialize
          @some_query = :no_some_query_given
        end
      end

      fake = SomeFakeClass.new
      fake.some_other_query = 'set to non default'

      expect(fake.defaulted_attrs).to include(:some_query.to_s)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pgit-1.0.0 spec/pgit/helpers/query_methods_spec.rb