Skip to content

Commit e3de908

Browse files
committed
refactor: have testing.rb require rspec.rb
This eliminates the conditional check for RSpecHelpers and simplifies client usage - they only need to require code_teams/testing.
1 parent ba490b7 commit e3de908

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ end
116116
`code_teams` provides test helpers for creating temporary teams in your specs without writing YML files to disk. Add the following to your `spec_helper.rb` (or `rails_helper.rb`):
117117

118118
```ruby
119-
require 'code_teams/rspec'
119+
require 'code_teams/testing'
120120
121121
CodeTeams::Testing.enable!
122122
```

lib/code_teams/testing.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
require 'securerandom'
66
require 'code_teams'
7+
require 'code_teams/rspec'
78

89
module CodeTeams
910
# Utilities for tests that need a controlled set of teams without writing YML
@@ -26,7 +27,7 @@ def self.enable!
2627
return unless defined?(RSpec)
2728

2829
T.unsafe(RSpec).configure do |config|
29-
config.include CodeTeams::RSpecHelpers if defined?(CodeTeams::RSpecHelpers)
30+
config.include CodeTeams::RSpecHelpers
3031

3132
config.around do |example|
3233
example.run

spec/lib/code_teams/r_spec_helpers_integration_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require 'code_teams/rspec'
1+
require 'code_teams/testing'
22

33
CodeTeams::Testing.enable!
44

0 commit comments

Comments
 (0)