|
55 | 55 | data = JSON.parse( '["bar"]')
|
56 | 56 | e = ctx.evaluate( data )
|
57 | 57 | expect( ctx.failed_roots[0].failures.length ).to eq( 2 )
|
| 58 | + expect( ctx.failed_roots[0].failures[0].length ).to eq( 1 ) |
58 | 59 | expect( ctx.failed_roots[0].failures[1].length ).to eq( 1 )
|
59 |
| - expect( ctx.failed_roots[0].failures[2].length ).to eq( 1 ) |
60 | 60 | end
|
61 | 61 |
|
62 | 62 | it 'should have two fail level w/ one fail' do
|
63 | 63 | ctx = JCR::Context.new( '[ 0..2 *2 ]', false )
|
64 | 64 | data = JSON.parse( '[1, "bar"]')
|
65 | 65 | e = ctx.evaluate( data )
|
66 | 66 | expect( ctx.failed_roots[0].failures.length ).to eq( 2 )
|
| 67 | + expect( ctx.failed_roots[0].failures[0].length ).to eq( 1 ) |
67 | 68 | expect( ctx.failed_roots[0].failures[1].length ).to eq( 1 )
|
68 |
| - expect( ctx.failed_roots[0].failures[2].length ).to eq( 1 ) |
69 | 69 | end
|
70 | 70 |
|
71 | 71 | it 'should have two fail level w/ one fail also' do
|
72 | 72 | ctx = JCR::Context.new( '[ 0..2 *2 ]', false )
|
73 | 73 | data = JSON.parse( '["bar", 1]')
|
74 | 74 | e = ctx.evaluate( data )
|
75 | 75 | expect( ctx.failed_roots[0].failures.length ).to eq( 2 )
|
| 76 | + expect( ctx.failed_roots[0].failures[0].length ).to eq( 1 ) |
76 | 77 | expect( ctx.failed_roots[0].failures[1].length ).to eq( 1 )
|
77 |
| - expect( ctx.failed_roots[0].failures[2].length ).to eq( 1 ) |
78 | 78 | end
|
79 | 79 |
|
80 | 80 | it 'should have two fail level w/ or' do
|
81 | 81 | ctx = JCR::Context.new( '[ "foo" | "bar" ]', false )
|
82 | 82 | data = JSON.parse( '["baz"]')
|
83 | 83 | e = ctx.evaluate( data )
|
84 | 84 | expect( ctx.failed_roots[0].failures.length ).to eq( 2 )
|
85 |
| - expect( ctx.failed_roots[0].failures[1].length ).to eq( 1 ) |
86 |
| - expect( ctx.failed_roots[0].failures[2].length ).to eq( 2 ) |
| 85 | + expect( ctx.failed_roots[0].failures[0].length ).to eq( 1 ) |
| 86 | + expect( ctx.failed_roots[0].failures[1].length ).to eq( 2 ) |
87 | 87 | end
|
88 | 88 |
|
89 | 89 | it 'should have two fail level w/ two fail' do
|
90 | 90 | ctx = JCR::Context.new( '[ ("foo" | "bar"), 0..2 ]', false )
|
91 | 91 | data = JSON.parse( '["baz", 3]')
|
92 | 92 | e = ctx.evaluate( data )
|
93 | 93 | expect( ctx.failed_roots[0].failures.length ).to eq( 3 )
|
| 94 | + expect( ctx.failed_roots[0].failures[0].length ).to eq( 1 ) |
94 | 95 | expect( ctx.failed_roots[0].failures[1].length ).to eq( 1 )
|
95 |
| - expect( ctx.failed_roots[0].failures[2].length ).to eq( 1 ) |
96 |
| - expect( ctx.failed_roots[0].failures[3].length ).to eq( 2 ) |
| 96 | + expect( ctx.failed_roots[0].failures[2].length ).to eq( 2 ) |
97 | 97 | end
|
98 | 98 |
|
99 | 99 | end
|
0 commit comments