Sha256: a3f1af989ed89620a5003042f0c46c56d970a6360e90fe07e6b77846f538b11a
Contents?: true
Size: 1.76 KB
Versions: 3
Compression:
Stored size: 1.76 KB
Contents
require 'helper' require 'pilfer/profiler' describe Pilfer::Profiler do let(:reporter) { stub(:reporter, :write => nil) } let(:reporter_options) { stub(:reporter_options) } let(:description) { stub(:description) } let(:profiler) { stub(:profiler, :call => :profiler_response) } let(:start) { stub(:start) } describe '#profile' do it 'profiles all files by default' do profiler.should_receive(:call).with(/./) Pilfer::Profiler.new(reporter). profile(description, reporter_options, profiler) { } end it 'returns value of app' do profiler = lambda {|*args, &app| app.call :profiler_response } response = Pilfer::Profiler.new(reporter). profile(description, reporter_options, profiler) { :app_response } response.should eq(:app_response) end it 'writes profile to reporter' do reporter.should_receive(:write). with(:profiler_response, start, description, reporter_options) Pilfer::Profiler.new(reporter). profile(description, reporter_options, profiler, start) { } end end describe '#profile_files_matching' do let(:matcher) { stub(:matcher) } it 'passes file matcher to profiler' do profiler.should_receive(:call).with(matcher) Pilfer::Profiler.new(reporter). profile_files_matching(matcher, description, reporter_options, profiler) { } end it 'writes profile to reporter' do reporter.should_receive(:write). with(:profiler_response, start, description, reporter_options) Pilfer::Profiler.new(reporter). profile_files_matching(matcher, description, reporter_options, profiler, start) { } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
pilfer-1.0.2 | spec/pilfer/profiler_spec.rb |
pilfer-1.0.1 | spec/pilfer/profiler_spec.rb |
pilfer-1.0.0 | spec/pilfer/profiler_spec.rb |