Skip to content

Commit

Permalink
Fix non-CRuby tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc committed Sep 10, 2021
1 parent 72f7750 commit 1ccd183
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 10 additions & 2 deletions spec/datadog/core/environment/vm_cache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
describe '.available?' do
subject(:available?) { described_class.available? }

it { is_expected.to eq(PlatformHelpers.mri?) }
context 'with CRuby', if: PlatformHelpers.mri? do
it { is_expected.to be_truthy }
end

context 'with non-CRuby', unless: PlatformHelpers.mri? do
it { is_expected.to be_falsey }
end
end

context 'with CRuby', if: PlatformHelpers.mri? do
context 'with CRuby' do
before { skip('This feature is only supported in CRuby') unless PlatformHelpers.mri? }

describe '.global_constant_state' do
subject(:global_constant_state) { described_class.global_constant_state }

Expand Down
8 changes: 6 additions & 2 deletions spec/ddtrace/runtime/metrics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,12 @@
end
end

context 'including VMCache stats', if: PlatformHelpers.mri? do
before { allow(runtime_metrics).to receive(:gauge) }
context 'including VMCache stats' do
before do
skip('This feature is only supported in CRuby') unless PlatformHelpers.mri?

allow(runtime_metrics).to receive(:gauge)
end

context 'with Ruby < 3', if: RUBY_VERSION < '3.0.0' do
it 'records global cache counters' do
Expand Down

0 comments on commit 1ccd183

Please sign in to comment.