From 1089282acc3d3a284b092dcaa06fc241bceb4b02 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 9 Jan 2025 13:27:43 +0900 Subject: [PATCH] Make benchmark exapmles as optional --- spec/syntax_suggest/integration/syntax_suggest_spec.rb | 2 +- spec/syntax_suggest/spec_helper.rb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/syntax_suggest/integration/syntax_suggest_spec.rb b/spec/syntax_suggest/integration/syntax_suggest_spec.rb index 9071d37c1b..d9772225af 100644 --- a/spec/syntax_suggest/integration/syntax_suggest_spec.rb +++ b/spec/syntax_suggest/integration/syntax_suggest_spec.rb @@ -235,5 +235,5 @@ module SyntaxSuggest end_is_missing_here EOM end - end + end if defined?(::Benchmark) end diff --git a/spec/syntax_suggest/spec_helper.rb b/spec/syntax_suggest/spec_helper.rb index 89bc9f4ab1..b5d2924e69 100644 --- a/spec/syntax_suggest/spec_helper.rb +++ b/spec/syntax_suggest/spec_helper.rb @@ -3,7 +3,10 @@ require "bundler/setup" require "syntax_suggest/api" -require "benchmark" +begin + require "benchmark" +rescue LoadError +end require "tempfile" RSpec.configure do |config|