From 52ceccc9234a373ae1b78f33f8fd49396af9cc05 Mon Sep 17 00:00:00 2001 From: Vít Ondruch Date: Fri, 23 Jan 2015 16:53:51 +0100 Subject: Add smoke test. --- rubygem-debug_inspector.spec | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 '#' + 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} -- cgit