File: shared_examples_test.rb

package info (click to toggle)
ruby-knapsack 1.18.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,084 kB
  • sloc: ruby: 2,832; makefile: 4; sh: 3
file content (29 lines) | stat: -rw-r--r-- 488 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'test_helper'

class Minitest::SharedExamples < Module
  include Minitest::Spec::DSL if RUBY_VERSION != "1.9.3"
end

SharedExampleSpec = Minitest::SharedExamples.new do
  def setup
    sleep 0.1
  end

  def test_mal
    sleep 0.1
    assert_equal 4, 2 * 2
  end

  def test_no_way
    sleep 0.2
    refute_match(/^no/i, 'yes')
  end

  def test_that_will_be_skipped
    skip 'test this later'
  end
end

describe "test that use SharedExamples" do
  include SharedExampleSpec
end