debian-mirror-gitlab/spec/lib/gitlab/github_import/representation/expose_attribute_spec.rb
2020-08-09 17:44:08 +05:30

22 lines
475 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.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