Module: Sapphire::Testing::TestRunnerAdapter

Defined in:
lib/sapphire/Testing/TestRunnerAdapter.rb

Instance Method Summary collapse

Instance Method Details

#execute(id) ⇒ Object



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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/sapphire/Testing/TestRunnerAdapter.rb', line 5

def execute(id)

  self.backgrounds.each do |b|

    b.execute id

  end

  self.givens.each do |g|

    g.when.each do |w|

      g.execute id

      g.and.each do |g_a|

        g_a.execute id

      end

      w.execute id

      w.and.each do |w_a|

        w_a.execute id

      end

      w.then.each do |t|

        t.execute id

        t.and.each do |t_a|

          t_a.execute id

        end

      end

    end

    if(g.finally)

      g.finally.execute id

    end

  end

end