Skip to content

Commit

Permalink
tests ugh
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Jun 6, 2024
1 parent b42cb15 commit 0473028
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 0 additions & 2 deletions spec/datadog/di/configuration/settings_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'spec_helper'

RSpec.describe Datadog::DI::Configuration::Settings do
subject(:settings) { Datadog::Core::Configuration::Settings.new }

Expand Down
15 changes: 10 additions & 5 deletions spec/datadog/di/hook_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#require 'spec_helper'
require 'datadog/di/hook'
require_relative 'hook_line'

Expand All @@ -24,7 +23,7 @@ def hook_test_method_with_kwarg(kwarg:)
end
end

describe Datadog::DI::Hook do
RSpec.describe Datadog::DI::Hook do
let(:observed_calls) { [] }

after do
Expand All @@ -41,7 +40,9 @@ def hook_test_method_with_kwarg(kwarg:)
HookTestClass.new.hook_test_method.should == 42

observed_calls.length.should == 1
observed_calls.first.should == {rv: 42}
observed_calls.first.keys.sort.should == [:duration, :rv]
observed_calls.first[:rv].should == 42
observed_calls.first[:duration].should be_a(Float)
end
end

Expand All @@ -54,7 +55,9 @@ def hook_test_method_with_kwarg(kwarg:)
HookTestClass.new.hook_test_method_with_arg(2).should == 2

observed_calls.length.should == 1
observed_calls.first.should == {rv: 2}
observed_calls.first.keys.sort.should == [:duration, :rv]
observed_calls.first[:rv].should == 2
observed_calls.first[:duration].should be_a(Float)
end
end

Expand All @@ -71,7 +74,9 @@ def hook_test_method_with_kwarg(kwarg:)
HookTestClass.new.hook_test_method.should == 42

observed_calls.length.should == 1
observed_calls.first.should == {rv: 42}
observed_calls.first.keys.sort.should == [:duration, :rv]
observed_calls.first[:rv].should == 42
observed_calls.first[:duration].should be_a(Float)
end
end
end
Expand Down

0 comments on commit 0473028

Please sign in to comment.