forked from rubys/awdwr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkinout.rb
63 lines (54 loc) · 2.38 KB
/
checkinout.rb
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
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
56
57
58
59
60
61
62
63
require 'test_gorp'
class InsideOutTest < Book::TestCase
input 'insideout'
output 'checkinout'
section 1.1, 'XML to Raw SQLite3' do
assert_select '.stderr', 'SQL error: no such table: products'
assert_select '.stdout', '3 tests, 3 assertions, 3 failures, 0 errors'
assert_select '.stdout', '3 tests, 12 assertions, 0 failures, 0 errors'
assert_select '.stderr', /table products already exists/
assert_select '.stdout', /Initialized empty Git repository/
end
section 1.2, 'Update Using Raw SQLite3' do
assert_select '.stderr', /no such column: base_id/
assert_select '.stdout', '3 tests, 12 assertions, 0 failures, 0 errors'
end
section 1.3, 'Update Using Raw SQLite3' do
assert_select '.stdout', '3 tests, 12 assertions, 0 failures, 0 errors'
end
section 2.1, 'Rack' do
assert_select '.stdout', '1 tests, 3 assertions, 0 failures, 0 errors'
assert_select 'h1', 'Pragmatic Bookshelf'
assert_select 'h2', 'Pragmatic Unit Testing (C#)'
assert_select 'p', '27.75'
assert_select '.stdout', '<products type="array">'
assert_select '.stdout', '3 tests, 12 assertions, 0 failures, 0 errors'
end
section 2.2, 'Capistrano' do
assert_select '.stdout', '[done] capified!'
assert_select '.stdout', 'You appear to have all necessary dependencies installed'
assert_select '.stderr', ' ** transaction: commit'
assert_select 'h1', 'Pragmatic Bookshelf'
assert_select 'h2', 'Pragmatic Unit Testing (C#)'
assert_select 'p', '27.75'
assert_select '.stdout', '<products type="array">'
end
section 2.3, 'whenever' do
assert_select '.stdout', '3 tests, 12 assertions, 0 failures, 0 errors'
assert_select '.stdout', '[done] wheneverized!'
assert_select '.stdout', /15 4 \* \* \* cd .*; ruby load_products.rb/
assert_select '.stderr', /crontab file updated/
end
section 3.1, 'convert to rails' do
assert_select '.stdout', /== CreateProducts: migrated/
assert_select '.stdout', '3 tests, 0 assertions, 0 failures, 3 errors'
assert_select '.stdout', '3 tests, 12 assertions, 0 failures, 0 errors'
assert_select '.stdout', '7 tests, 10 assertions, 0 failures, 0 errors'
assert_select 'td', '24.95'
assert_select 'input[value=/images/auto.jpg]'
end
section 3.2, 'deploy rails' do
assert_select '.stderr', :text => /failed:/, :count => 0
assert_select 'tr:only-child'
end
end