Module: Ghaki::Stats::SpecHelper
- Defined in:
- lib/ghaki/stats/spec_helper.rb
Overview
Helper for mocking Ghaki::Stats objects in unit tests.
Constant Summary collapse
Instance Method Summary collapse
-
#make_safe_stats(klass = DEF_CLASS) ⇒ Object
Creates Ghaki::Stats object: - Using null sink formatting to avoid file access.
-
#setup_safe_stats(klass = DEF_CLASS) ⇒ Object
Creates @stats member using :make_safe_stats.
Instance Method Details
#make_safe_stats(klass = DEF_CLASS) ⇒ Object
Creates Ghaki::Stats object:
-
Using null sink formatting to avoid file access.
14 15 16 17 18 |
# File 'lib/ghaki/stats/spec_helper.rb', line 14 def make_safe_stats klass=DEF_CLASS obj = klass.new obj.format = Ghaki::Stats::Format::Null.new obj end |
#setup_safe_stats(klass = DEF_CLASS) ⇒ Object
Creates @stats member using :make_safe_stats
21 22 23 |
# File 'lib/ghaki/stats/spec_helper.rb', line 21 def setup_safe_stats klass=DEF_CLASS @stats = make_safe_stats(klass) end |