File: spec_testspec_order.rb

package info (click to toggle)
ruby-test-spec 0.10.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 280 kB
  • sloc: ruby: 1,851; makefile: 9
file content (26 lines) | stat: -rw-r--r-- 353 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
25
26
require 'test/spec'

$foo = 0

context "Context First" do
  specify "runs before Second" do
    $foo.should.equal 0
    $foo += 1
  end
end

context "Context Second" do
  specify "runs before Last" do
    $foo.should.equal 1
    $foo += 1
  end
end

context "Context Last" do
  specify "runs last" do
    $foo.should.equal 2
    $foo += 1
  end
end