Skip to content

Commit e89db7b

Browse files
committed
chore: adjust specs
1 parent bdd8a43 commit e89db7b

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

spec/task-1_spec.rb

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@
22
require 'rspec-benchmark'
33
require_relative '../task-1'
44

5-
RSpec.configure do |config|
6-
config.include RSpec::Benchmark::Matchers
7-
end
8-
95
RSpec.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
2127
end

0 commit comments

Comments
 (0)