File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change 22require 'rspec-benchmark'
33require_relative '../task-1'
44
5- RSpec . configure do |config |
6- config . include RSpec ::Benchmark ::Matchers
7- end
8-
95RSpec . describe 'work' do
6+ include RSpec ::Benchmark ::Matchers
7+
108 it 'should be linear' do
11- `head -n 10000 data_large.txt > data.txt`
9+ expect { |number , _ |
10+ `head -n #{ number * 1000 } data_large.txt > data.txt`
1211
13- expect { work } . to perform_linear
12+ work
13+ } . to perform_linear . in_range ( 1 , 100 )
1414 end
1515
16- it 'should perform under 15 seconds' do
17- `cp data_large.txt data.txt`
16+ it 'should perform under 5 seconds' do
17+ `head -n 1000000 data_large.txt > data.txt`
1818
19- expect { work } . to perform_under ( 30 ) . sec
19+ expect { work } . to perform_under ( 5 ) . sec
2020 end
21+
22+ # it 'should perform under 30 seconds' do
23+ # `cp data_large.txt data.txt`
24+
25+ # expect { work }.to perform_under(30).sec
26+ # end
2127end
You can’t perform that action at this time.
0 commit comments