Skip to content
Snippets Groups Projects
Select Git revision
  • marioceli-master-patch-34687
  • mshaw1-master-patch-68287
  • andr3-master-patch-06736
  • 363356-positive-intent-first
  • russell/improve-app-security-tools-introduction
  • 361217-delete-streaming-header
  • 361641-comments-discussion-header
  • morefice/add-drop-sequence-helper
  • remove-modal-ok-and-modal-cancel-slots-usage
  • sy-do-not-set-unsupported-sort-order-from-user-preference
  • master default protected
  • pedropombeiro/363308/add-html-field
  • qa-shl-group-inheritance-auth-spec
  • nd/bulk-update-member-await-active-state
  • fix-multiple-stop-actions-n-plus-1-queries
  • 358987-cleanup-feature-flag
  • release-tools/update-gitaly
  • migrate-retry-migration-button
  • id-jwt-gitlab-shell
  • 334810-add-placeholder-assignees-query
  • v15.0.0-ee
  • v14.10.3-ee
  • v15.0.0-rc44-ee
  • v15.0.0-rc43-ee
  • v15.0.0-rc42-ee
  • v14.10.2-ee
  • v14.8.6-ee
  • v14.9.4-ee
  • v14.10.1-ee
  • v14.10.0-ee
  • v14.10.0-rc42-ee
  • v14.9.3-ee
  • v14.6.7-ee
  • v14.7.7-ee
  • v14.8.5-ee
  • v14.9.2-ee
  • v14.7.6-ee
  • v14.9.1-ee
  • v14.9.0-ee
  • v14.9.0-rc42-ee
40 results

environment_spec.rb

Forked from GitLab.org / GitLab
Source project has a limited visibility.
  • Yorick Peterse's avatar
    45812f1c
    Fix Environment terminal specs for EE · 45812f1c
    Yorick Peterse authored
    In EE we redefine Environment#terminals, which makes it impossible to
    use `allow_any_instance_of(Environment)` or
    `expect_any_instance_of(Environment)`. Other approaches of stubbing
    this class, such as by stubbing `new`, only result in spec failures.
    
    To solve this issue, we add a simple `defined?(EE)` check in the tests
    to change the thing that we are testing. This is rather obnoxious,
    because it requires EE knowledge in CE, and can break if
    `EE::Environment` is removed without updating CE. Unfortunately, it
    appears to be the only solution we have apart from modifying these tests
    in EE (which would cause merge conflicts).
    Fix Environment terminal specs for EE
    Yorick Peterse authored
    In EE we redefine Environment#terminals, which makes it impossible to
    use `allow_any_instance_of(Environment)` or
    `expect_any_instance_of(Environment)`. Other approaches of stubbing
    this class, such as by stubbing `new`, only result in spec failures.
    
    To solve this issue, we add a simple `defined?(EE)` check in the tests
    to change the thing that we are testing. This is rather obnoxious,
    because it requires EE knowledge in CE, and can break if
    `EE::Environment` is removed without updating CE. Unfortunately, it
    appears to be the only solution we have apart from modifying these tests
    in EE (which would cause merge conflicts).