Skip to content

Commit

Permalink
specs for rspec and more
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Aug 22, 2023
1 parent f3177cf commit 787bbe0
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Datadog
module CI
module Contrib
module Minitest
module TestHelper
module Hooks
def before_setup: () -> (nil | untyped)

def after_teardown: () -> untyped
Expand Down
2 changes: 2 additions & 0 deletions sig/datadog/ci/contrib/rspec/example.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ module Datadog
module Example
def self.included: (untyped base) -> untyped
module InstanceMethods
include ::RSpec::Core::Example

def run: (untyped example_group_instance, untyped reporter) -> untyped

private
Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/ci/ext/app_types.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Datadog
module CI
module Ext
module AppTypes
TYPE_TEST: "test"
TYPE_TEST: String
end
end
end
Expand Down
1 change: 1 addition & 0 deletions vendor/rbs/ddtrace/0/datadog/tracing.rbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Datadog
module Tracing
def self.active_trace: () -> Datadog::Tracing::TraceSegment
def self.trace: (String span_name, Hash[untyped, untyped] options) ?{ (untyped span, untyped trace) -> untyped } -> Datadog::Tracing::SpanOperation
end
end
25 changes: 25 additions & 0 deletions vendor/rbs/ddtrace/0/datadog/tracing/event.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module Datadog
module Tracing
module Events
def self.included: (untyped base) -> untyped

module ClassMethods
def build: (**untyped event_handlers) -> untyped
end

module InstanceMethods
def subscribe: (**untyped event_handlers) -> (nil | untyped)
end
end

class Event
attr_reader name: untyped
attr_reader subscriptions: untyped

def initialize: (untyped name) -> void
def subscribe: () ?{ () -> untyped } -> untyped
def unsubscribe_all!: () -> true
def publish: (*untyped args) -> true
end
end
end
135 changes: 135 additions & 0 deletions vendor/rbs/ddtrace/0/datadog/tracing/span_operation.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
module Datadog
module Tracing
class SpanOperation
include Metadata
include Metadata::Tagging
include Metadata::Errors
prepend Metadata::Analytics

attr_reader end_time: untyped

attr_reader id: untyped

attr_reader name: untyped

attr_reader parent_id: untyped

attr_reader resource: untyped

attr_reader service: untyped

attr_reader start_time: untyped

attr_reader trace_id: untyped

attr_reader type: untyped

attr_accessor status: untyped

def initialize: (untyped name, ?child_of: untyped?, ?events: untyped?, ?on_error: untyped?, ?parent_id: ::Integer, ?resource: untyped, ?service: untyped?, ?start_time: untyped?, ?tags: untyped?, ?trace_id: untyped?, ?type: untyped?) -> void

def name=: (untyped name) -> untyped

def type=: (untyped `type`) -> untyped

def service=: (untyped service) -> untyped

def resource=: (untyped resource) -> untyped

def measure: () { (untyped) -> untyped } -> untyped

def start: (?untyped? start_time) -> self

def stop: (?untyped? stop_time) -> (nil | self)

def started?: () -> untyped

def stopped?: () -> untyped

def start_time=: (untyped time) -> untyped

def end_time=: (untyped time) -> untyped

def finish: (?untyped? end_time) -> untyped

def finished?: () -> untyped

def duration: () -> untyped

def set_error: (untyped e) -> untyped

def to_s: () -> ::String

def to_hash: () -> untyped

def pretty_print: (untyped q) -> untyped

class Events
include Tracing::Events

DEFAULT_ON_ERROR: untyped

attr_reader after_finish: untyped

attr_reader after_stop: untyped

attr_reader before_start: untyped

def initialize: (?on_error: untyped?) -> void

def on_error: () -> untyped

class AfterFinish < Tracing::Event
def initialize: () -> void
end

class AfterStop < Tracing::Event
def initialize: () -> void
end

class BeforeStart < Tracing::Event
def initialize: () -> void
end

class OnError
def initialize: (untyped default) -> void

def wrap_default: () { (untyped, untyped) -> untyped } -> untyped

def publish: (*untyped args) -> true
end
end

class AlreadyStartedError < StandardError
def message: () -> "Cannot measure an already started span!"
end

private

attr_reader events: untyped

attr_reader parent: untyped

attr_reader span: untyped

module RefineNil
end

def build_span: () -> untyped

def parent=: (untyped parent) -> untyped

def duration_marker: () -> untyped

def start_time_nano: () -> untyped

def duration_nano: () -> untyped

alias span_id id

alias span_type type

alias span_type= type=
end
end
end
11 changes: 8 additions & 3 deletions vendor/rbs/rspec/0/rspec.rbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
class RSpec
module RSpec
end

class RSpec::Core
module RSpec::Core
end

class RSpec::Core::Example
module RSpec::Core::Example
def run: () -> untyped
def execution_result: () -> untyped
def metadata: () -> untyped
def description: () -> String
def full_description: () -> String
end

0 comments on commit 787bbe0

Please sign in to comment.