summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/github_import/representation/expose_attribute_spec.rb
blob: e3b48df4ae9341c4002f89d49f243ea2ac6f5d7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'spec_helper'

describe Gitlab::GithubImport::Representation::ExposeAttribute do
  it 'defines a getter method that returns an attribute value' do
    klass = Class.new do
      include Gitlab::GithubImport::Representation::ExposeAttribute

      expose_attribute :number

      attr_reader :attributes

      def initialize
        @attributes = { number: 42 }
      end
    end

    expect(klass.new.number).to eq(42)
  end
end