summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rubygem-debug_inspector.spec19
1 files changed, 19 insertions, 0 deletions
diff --git a/rubygem-debug_inspector.spec b/rubygem-debug_inspector.spec
index 9bf0a1f..2fb4b04 100644
--- a/rubygem-debug_inspector.spec
+++ b/rubygem-debug_inspector.spec
@@ -54,6 +54,25 @@ rm -rf %{buildroot}%{gem_instdir}/ext/
chmod -x %{buildroot}%{gem_dir}/gems/%{gem_name}-%{version}/Rakefile
+%check
+pushd .%{gem_instdir}
+# No upstream test suite available :/ but we can do some smoke test :)
+ruby -Ilib:$(dirs +1)%{gem_extdir_mri} - << \EOF | grep '#<Class:RubyVM::DebugInspector>'
+ require 'debug_inspector'
+
+ # Open debug context
+ # Passed `dc' is only active in a block
+ RubyVM::DebugInspector.open { |dc|
+ # backtrace locations (returns an array of Thread::Backtrace::Location objects)
+ locs = dc.backtrace_locations
+
+ # class of i-th caller frame
+ p dc.frame_class(0)
+ }
+EOF
+popd
+
+
%files
%doc %{gem_instdir}/README.md
%dir %{gem_instdir}