File: timer_spec.rb

package info (click to toggle)
ruby-cucumber-core 1.5.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 580 kB
  • sloc: ruby: 5,763; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 596 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'cucumber/core/test/timer'
require 'cucumber/core/test/duration_matcher'

module Cucumber
  module Core
    module Test
      describe Timer do
        before do
          allow(Timer::MonotonicTime).to receive(:time_in_nanoseconds)
                                            .and_return(525702744080000, 525702744080001)
        end

        it "returns a Result::Duration object" do
          timer = Timer.new.start
          expect( timer.duration ).to be_duration 1
        end

        it "would be slow to test" do
          # so we won't
        end
      end
    end
  end
end