Skip to content

Commit

Permalink
Bring in spec helpers from raabro
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Aug 15, 2024
1 parent a9a2628 commit 025ad7b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/parse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@
expect(o).to eq(n)
end
end

it "returns nil quickly if the input is useless and long, gh-104" do

o = Fugit.parse('0 0' + ' 0' * 10_000 + ' 1 jan * UTC')
p o
# TODO
end
end

describe '.do_parse' do
Expand Down
11 changes: 11 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ def unrequire_chronic

Object.send(:remove_const, :Chronic)
end

def monow; Process.clock_gettime(Process::CLOCK_MONOTONIC); end

def do_time(&block)

t0 = monow

r = block.call

[ r, monow - t0 ]
end
end # Helpers

RSpec.configure do |c|
Expand Down

0 comments on commit 025ad7b

Please sign in to comment.