Commit d4ed5b2e authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add abstract base class for core CI status

parent 5df3e8b8
module Gitlab::Ci
module Status
module Core
# Base abstract class fore core status
#
class Base
def initialize(subject)
@subject = subject
end
def icon
raise NotImplementedError
end
def label
raise NotImplementedError
end
def has_details?
raise NotImplementedError
end
def details_path
raise NotImplementedError
end
def has_action?
raise NotImplementedError
end
def action_icon
raise NotImplementedError
end
def action_path
raise NotImplementedError
end
end
end
end
end
module Gitlab::Ci module Gitlab::Ci
module Status module Status
module Core module Core
class Success class Success < Core::Base
def label def label
'passed' 'passed'
end end
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Core::Success do describe Gitlab::Ci::Status::Core::Success do
subject { described_class.new(double('subject')) }
describe '#label' do describe '#label' do
it { expect(subject.label).to eq 'passed' } it { expect(subject.label).to eq 'passed' }
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment