Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ if ENV["DEPRECATION_TRACKER"]
end
```

If using cucumber, create new file `features/support/deprecation_tracker.rb` with following content:

```ruby
if ENV["DEPRECATION_TRACKER"]
DeprecationTracker.track_cucumber(
shitlist_path: "features/support/deprecation_warning.shitlist.json",
mode: ENV["DEPRECATION_TRACKER"],
transform_message: -> (message) { message.gsub("#{Rails.root}/", "") }
)
end
```

> Keep in mind this is currently not compatible with the `minitest/parallel_fork` gem!

Once you have that, you can start using deprecation tracking in your tests:
Expand Down
19 changes: 19 additions & 0 deletions lib/deprecation_tracker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,25 @@ def self.track_rspec(rspec_config, opts = {})
end
end

def self.track_cucumber(opts = {})
tracker = init_tracker(opts)

Around do |scenario, block|
feature_file = scenario.location.file
tracker.bucket = feature_file.gsub(Rails.root.to_s, ".")

begin
block.call
ensure
tracker.bucket = nil
end
end

at_exit do
tracker.after_run
end
end

def self.track_minitest(opts = {})
tracker = init_tracker(opts)

Expand Down