mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
parent
56ad79694b
commit
e956caea88
Notes:
git
2022-10-18 07:33:41 +00:00
2 changed files with 13 additions and 7 deletions
|
@ -11,12 +11,6 @@ RSpec.describe "bundle install with complex dependencies", :realworld => true do
|
||||||
gem "mongoid", ">= 0.10.2"
|
gem "mongoid", ">= 0.10.2"
|
||||||
G
|
G
|
||||||
|
|
||||||
start_time = Time.now
|
expect { bundle "lock" }.to take_less_than(18) # seconds
|
||||||
|
|
||||||
bundle "lock"
|
|
||||||
|
|
||||||
duration = Time.now - start_time
|
|
||||||
|
|
||||||
expect(duration.to_f).to be < 18 # seconds
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -97,6 +97,18 @@ module Spec
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
RSpec::Matchers.define :take_less_than do |seconds|
|
||||||
|
match do |actual|
|
||||||
|
start_time = Time.now
|
||||||
|
|
||||||
|
actual.call
|
||||||
|
|
||||||
|
(Time.now - start_time).to_f < seconds
|
||||||
|
end
|
||||||
|
|
||||||
|
supports_block_expectations
|
||||||
|
end
|
||||||
|
|
||||||
define_compound_matcher :read_as, [exist] do |file_contents|
|
define_compound_matcher :read_as, [exist] do |file_contents|
|
||||||
diffable
|
diffable
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue