Sha256: c8e1ca332542e32921deb326856feda24f3c8514305dd139ff48266861e94211

Contents?: true

Size: 804 Bytes

Versions: 17

Compression:

Stored size: 804 Bytes

Contents

class StubApp < OpenStruct
  def vhosts
    services.map(&:vhosts).flatten
  end

  def each_vhost(&block)
    return enum_for(:each_vhost) if block.nil?
    vhosts.each(&block)
  end

  def each_service(&block)
    return enum_for(:each_service) if block.nil?
    services.each(&block)
  end

  def each_configuration(&block)
    return enum_for(:each_configuration) if block.nil?
    configurations.each(&block)
  end
end

Fabricator(:app, from: :stub_app) do
  id { Fabricate.sequence(:app_id) { |i| i } }
  handle 'hello'
  status 'provisioned'
  git_repo { Fabricate.sequence(:app_git_repo) { |i| "git://#{i}.git" } }
  account
  services { [] }
  configurations { [] }
  current_configuration { nil }
  errors { Aptible::Resource::Errors.new }

  after_create { |app| app.account.apps << app }
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
aptible-cli-0.18.0 spec/fabricators/app_fabricator.rb
aptible-cli-0.17.2 spec/fabricators/app_fabricator.rb
aptible-cli-0.17.1 spec/fabricators/app_fabricator.rb
aptible-cli-0.17.0 spec/fabricators/app_fabricator.rb
aptible-cli-0.16.9 spec/fabricators/app_fabricator.rb
aptible-cli-0.16.8 spec/fabricators/app_fabricator.rb
aptible-cli-0.16.7 spec/fabricators/app_fabricator.rb
aptible-cli-0.16.6 spec/fabricators/app_fabricator.rb
aptible-cli-0.16.5 spec/fabricators/app_fabricator.rb
aptible-cli-0.16.4 spec/fabricators/app_fabricator.rb
aptible-cli-0.16.3 spec/fabricators/app_fabricator.rb
aptible-cli-0.16.2 spec/fabricators/app_fabricator.rb
aptible-cli-0.16.1 spec/fabricators/app_fabricator.rb
aptible-cli-0.16.0 spec/fabricators/app_fabricator.rb
aptible-cli-0.15.2 spec/fabricators/app_fabricator.rb
aptible-cli-0.15.1 spec/fabricators/app_fabricator.rb
aptible-cli-0.15.0 spec/fabricators/app_fabricator.rb