Skip to content

Commit

Permalink
Add #notify and return a future
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrylo committed Jun 6, 2024
1 parent b6c1c3d commit 492bbe2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/telebugs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@ class << self
def configure
yield Telebugs::Config.instance
end

def notify(error:)
Concurrent::Promises.future do
end
end
end
end
3 changes: 1 addition & 2 deletions telebugs.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

# Uncomment to register a new dependency of your gem
# spec.add_dependency "example-gem", "~> 1.0"
spec.add_dependency "concurrent-ruby", "~> 1.3"

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
Expand Down
6 changes: 6 additions & 0 deletions test/test_telebugs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ def test_configure_configures_project_key

assert_equal key, Telebugs::Config.instance.api_key
end

def test_notify_returns_a_future
future = Telebugs.notify(error: StandardError.new)

assert_instance_of Concurrent::Promises::Future, future
end
end

0 comments on commit 492bbe2

Please sign in to comment.