Commit b86d8afe authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fold core/extended status modules to reduce nesting

parent d55ff247
module Gitlab::Ci
module Gitlab
module Ci
module Status
module Core
class Canceled < Core::Base
class Canceled < Status::Core
def text
'canceled'
end
......
module Gitlab::Ci
module Gitlab
module Ci
module Status
module Core
# Base abstract class fore core status
#
class Base
class Core
include Gitlab::Routing.url_helpers
def initialize(subject)
......
module Gitlab::Ci
module Gitlab
module Ci
module Status
module Core
class Created < Core::Base
class Created < Status::Core
def text
'created'
end
......
module Gitlab::Ci
module Gitlab
module Ci
module Status
module Extended
module Base
def matches?(_subject)
raise NotImplementedError
end
......
module Gitlab::Ci
module Status
class Factory
end
end
end
module Gitlab::Ci
module Gitlab
module Ci
module Status
module Core
class Failed < Core::Base
class Failed < Status::Core
def text
'failed'
end
......
module Gitlab::Ci
module Gitlab
module Ci
module Status
module Core
class Pending < Core::Base
class Pending < Status::Core
def text
'pending'
end
......
module Gitlab::Ci
module Gitlab
module Ci
module Status
module Extended
module Pipeline
module Common
def has_details?
......
module Gitlab::Ci
module Gitlab
module Ci
module Status
module Extended
module Pipeline
class SuccessWithWarnings < SimpleDelegator
extend Status::Extended::Base
extend Status::Extended
def text
'passed'
......
module Gitlab::Ci
module Gitlab
module Ci
module Status
module Core
class Running < Core::Base
class Running < Status::Core
def text
'running'
end
......
module Gitlab::Ci
module Gitlab
module Ci
module Status
module Core
class Skipped < Core::Base
class Skipped < Status::Core
def text
'skipped'
end
......
module Gitlab::Ci
module Gitlab
module Ci
module Status
module Core
class Success < Core::Base
class Success < Status::Core
def text
'passed'
end
......
require 'spec_helper'
describe Gitlab::Ci::Status::Core::Canceled do
describe Gitlab::Ci::Status::Canceled do
subject { described_class.new(double('subject')) }
describe '#text' do
......
require 'spec_helper'
describe Gitlab::Ci::Status::Core::Created do
describe Gitlab::Ci::Status::Created do
subject { described_class.new(double('subject')) }
describe '#text' do
......
require 'spec_helper'
describe Gitlab::Ci::Status::Extended::Base do
describe Gitlab::Ci::Status::Extended do
subject do
Class.new.extend(described_class)
end
......
require 'spec_helper'
describe Gitlab::Ci::Status::Core::Failed do
describe Gitlab::Ci::Status::Failed do
subject { described_class.new(double('subject')) }
describe '#text' do
......
require 'spec_helper'
describe Gitlab::Ci::Status::Core::Pending do
describe Gitlab::Ci::Status::Pending do
subject { described_class.new(double('subject')) }
describe '#text' do
......
require 'spec_helper'
describe Gitlab::Ci::Status::Extended::Pipeline::Common do
describe Gitlab::Ci::Status::Pipeline::Common do
let(:pipeline) { create(:ci_pipeline) }
subject do
Gitlab::Ci::Status::Core::Success
Class.new(Gitlab::Ci::Status::Core)
.new(pipeline).extend(described_class)
end
......
require 'spec_helper'
describe Gitlab::Ci::Status::Extended::Pipeline::SuccessWithWarnings do
describe Gitlab::Ci::Status::Pipeline::SuccessWithWarnings do
subject do
described_class.new(double('status'))
end
......
require 'spec_helper'
describe Gitlab::Ci::Status::Core::Running do
describe Gitlab::Ci::Status::Running do
subject { described_class.new(double('subject')) }
describe '#text' do
......
require 'spec_helper'
describe Gitlab::Ci::Status::Core::Skipped do
describe Gitlab::Ci::Status::Skipped do
subject { described_class.new(double('subject')) }
describe '#text' do
......
require 'spec_helper'
describe Gitlab::Ci::Status::Core::Success do
describe Gitlab::Ci::Status::Success do
subject { described_class.new(double('subject')) }
describe '#text' do
......
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