fas_test 0.0.2 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/{fastest.rb → fastest} +2 -0
- data/fas_test.gemspec +17 -0
- data/test/fas_test_tests.rb +129 -1
- metadata +9 -16
data/bin/{fastest.rb → fastest}
RENAMED
data/fas_test.gemspec
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
spec = Gem::Specification.new do |s|
|
2
|
+
s.name = "fas_test"
|
3
|
+
s.version = "0.0.7"
|
4
|
+
s.authors = ["Graeme Hill"]
|
5
|
+
s.email = "graemekh@gmail.com"
|
6
|
+
s.homepage = "https://github.com/graeme-hill/fas_test"
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.description = File.open("README").read.gsub("\n","<br/><br/>")
|
9
|
+
s.summary = "A simple automated testing framework designed to be fast and easy to use."
|
10
|
+
s.files = ["README", "bin/fastest", "lib/fas_test.rb", "test/fas_test_tests.rb", "fas_test.gemspec"]
|
11
|
+
s.require_path = "lib"
|
12
|
+
s.bindir = "bin"
|
13
|
+
s.executables = ["fastest"]
|
14
|
+
s.test_files = ["test/fas_test_tests.rb"]
|
15
|
+
s.extra_rdoc_files = ["README"]
|
16
|
+
s.has_rdoc = true
|
17
|
+
end
|
data/test/fas_test_tests.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'sqlite3'
|
1
3
|
require 'stringio'
|
2
4
|
require 'lib/fas_test'
|
3
5
|
|
@@ -5,18 +7,144 @@ class FasTestTests < FasTest::TestClass
|
|
5
7
|
|
6
8
|
def setup
|
7
9
|
$stdout = StringIO.new
|
10
|
+
@db = SQLite3::Database.new ":memory:"
|
11
|
+
@db.execute("CREATE TABLE Foo (id int, foobar varchar(100));")
|
8
12
|
end
|
9
13
|
|
10
14
|
def teardown
|
15
|
+
@db.execute("DELETE FROM Foo;")
|
11
16
|
$stdout = STDOUT
|
12
17
|
end
|
13
|
-
|
18
|
+
|
14
19
|
def test__redirect_io
|
15
20
|
$stdout = StringIO.new
|
16
21
|
puts 'hello?'
|
17
22
|
assert_equal "hello?\n", $stdout.string
|
18
23
|
end
|
19
24
|
|
25
|
+
def test__this_is_a_temp_test11
|
26
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'qwer')")
|
27
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'asdf')")
|
28
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'zxcv')")
|
29
|
+
rows = @db.execute("SELECT foobar FROM Foo;")
|
30
|
+
|
31
|
+
assert_equal(3, rows.length)
|
32
|
+
assert_equal('qwer', rows[0][0])
|
33
|
+
assert_equal('asdf', rows[1][0])
|
34
|
+
assert_equal('zxcv', rows[2][0])
|
35
|
+
end
|
36
|
+
def test__this_is_a_temp_test10
|
37
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'qwer')")
|
38
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'asdf')")
|
39
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'zxcv')")
|
40
|
+
rows = @db.execute("SELECT foobar FROM Foo;")
|
41
|
+
|
42
|
+
assert_equal(3, rows.length)
|
43
|
+
assert_equal('qwer', rows[0][0])
|
44
|
+
assert_equal('asdf', rows[1][0])
|
45
|
+
assert_equal('zxcv', rows[2][0])
|
46
|
+
end
|
47
|
+
def test__this_is_a_temp_test9
|
48
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'qwer')")
|
49
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'asdf')")
|
50
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'zxcv')")
|
51
|
+
rows = @db.execute("SELECT foobar FROM Foo;")
|
52
|
+
|
53
|
+
assert_equal(3, rows.length)
|
54
|
+
assert_equal('qwer', rows[0][0])
|
55
|
+
assert_equal('asdf', rows[1][0])
|
56
|
+
assert_equal('zxcv', rows[2][0])
|
57
|
+
end
|
58
|
+
def test__this_is_a_temp_test8
|
59
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'qwer')")
|
60
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'asdf')")
|
61
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'zxcv')")
|
62
|
+
rows = @db.execute("SELECT foobar FROM Foo;")
|
63
|
+
|
64
|
+
assert_equal(3, rows.length)
|
65
|
+
assert_equal('qwer', rows[0][0])
|
66
|
+
assert_equal('asdf', rows[1][0])
|
67
|
+
assert_equal('zxcv', rows[2][0])
|
68
|
+
end
|
69
|
+
def test__this_is_a_temp_test7
|
70
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'qwer')")
|
71
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'asdf')")
|
72
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'zxcv')")
|
73
|
+
rows = @db.execute("SELECT foobar FROM Foo;")
|
74
|
+
|
75
|
+
assert_equal(3, rows.length)
|
76
|
+
assert_equal('qwer', rows[0][0])
|
77
|
+
assert_equal('asdf', rows[1][0])
|
78
|
+
assert_equal('zxcv', rows[2][0])
|
79
|
+
end
|
80
|
+
def test__this_is_a_temp_test6
|
81
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'qwer')")
|
82
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'asdf')")
|
83
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'zxcv')")
|
84
|
+
rows = @db.execute("SELECT foobar FROM Foo;")
|
85
|
+
|
86
|
+
assert_equal(3, rows.length)
|
87
|
+
assert_equal('qwer', rows[0][0])
|
88
|
+
assert_equal('asdf', rows[1][0])
|
89
|
+
assert_equal('zxcv', rows[2][0])
|
90
|
+
end
|
91
|
+
def test__this_is_a_temp_test5
|
92
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'qwer')")
|
93
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'asdf')")
|
94
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'zxcv')")
|
95
|
+
rows = @db.execute("SELECT foobar FROM Foo;")
|
96
|
+
|
97
|
+
assert_equal(3, rows.length)
|
98
|
+
assert_equal('qwer', rows[0][0])
|
99
|
+
assert_equal('asdf', rows[1][0])
|
100
|
+
assert_equal('zxcv', rows[2][0])
|
101
|
+
end
|
102
|
+
def test__this_is_a_temp_test4
|
103
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'qwer')")
|
104
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'asdf')")
|
105
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'zxcv')")
|
106
|
+
rows = @db.execute("SELECT foobar FROM Foo;")
|
107
|
+
|
108
|
+
assert_equal(3, rows.length)
|
109
|
+
assert_equal('qwer', rows[0][0])
|
110
|
+
assert_equal('asdf', rows[1][0])
|
111
|
+
assert_equal('zxcv', rows[2][0])
|
112
|
+
end
|
113
|
+
def test__this_is_a_temp_test3
|
114
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'qwer')")
|
115
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'asdf')")
|
116
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'zxcv')")
|
117
|
+
rows = @db.execute("SELECT foobar FROM Foo;")
|
118
|
+
|
119
|
+
assert_equal(3, rows.length)
|
120
|
+
assert_equal('qwer', rows[0][0])
|
121
|
+
assert_equal('asdf', rows[1][0])
|
122
|
+
assert_equal('zxcv', rows[2][0])
|
123
|
+
end
|
124
|
+
def test__this_is_a_temp_test2
|
125
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'qwer')")
|
126
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'asdf')")
|
127
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'zxcv')")
|
128
|
+
rows = @db.execute("SELECT foobar FROM Foo;")
|
129
|
+
|
130
|
+
assert_equal(3, rows.length)
|
131
|
+
assert_equal('qwer', rows[0][0])
|
132
|
+
assert_equal('asdf', rows[1][0])
|
133
|
+
assert_equal('zxcv', rows[2][0])
|
134
|
+
end
|
135
|
+
def test__this_is_a_temp_test12
|
136
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'qwer')")
|
137
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'asdf')")
|
138
|
+
@db.execute("INSERT INTO Foo VALUES (1, 'zxcv')")
|
139
|
+
rows = @db.execute("SELECT foobar FROM Foo;")
|
140
|
+
|
141
|
+
assert_equal(3, rows.length)
|
142
|
+
assert_equal('qwer', rows[0][0])
|
143
|
+
assert_equal('asdf', rows[1][0])
|
144
|
+
assert_equal('zxcv', rows[2][0])
|
145
|
+
end
|
146
|
+
|
147
|
+
|
20
148
|
def test__run_tests_in_class__results_are_valid
|
21
149
|
runner = FasTest::TestRunner.new
|
22
150
|
runner.run_tests_in_class(FasTestTestClassTests)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fas_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Graeme Hill
|
@@ -15,31 +15,24 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-25 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
22
|
-
description: "Auto-discovers test classes in the working directory and runs the tests with\
|
23
|
-
basically no boot up time and no configuration. It doesn't matter how you\n\
|
24
|
-
structure your project, instead, simple naming conventions are used:\n\n - All test files should be named *_tests.rb\n - All test methods should be named test__*\n\n\
|
25
|
-
Other things you need to know:\n\n - All test classes should inherit FasTest::TestClass\n - Your test class can define \"setup\" and/or \"teardown\" methods. They do what\n it sounds like they do.\n\n\
|
26
|
-
Take a look in the test folder to see an example of how the library is used.\n\
|
27
|
-
(fas_test is used to test itself).\n\n\
|
28
|
-
To actually run your tests just invoke fastest.rb from a command line. It will\n\
|
29
|
-
automatically recursively discover all of your test classes within the working\n\
|
30
|
-
directory and run there tests. "
|
22
|
+
description: "Auto-discovers test classes in the working directory and runs the tests with<br/><br/>basically no boot up time and no configuration. It doesn't matter how you<br/><br/>structure your project, instead, simple naming conventions are used:<br/><br/><br/><br/> - All test files should be named *_tests.rb<br/><br/> - All test methods should be named test__*<br/><br/><br/><br/>Other things you need to know:<br/><br/><br/><br/> - All test classes should inherit FasTest::TestClass<br/><br/> - Your test class can define \"setup\" and/or \"teardown\" methods. They do what<br/><br/> it sounds like they do.<br/><br/><br/><br/>Take a look in the test folder to see an example of how the library is used.<br/><br/>(fas_test is used to test itself).<br/><br/><br/><br/>To actually run your tests just invoke fastest.rb from a command line. It will<br/><br/>automatically recursively discover all of your test classes within the working<br/><br/>directory and run there tests. "
|
31
23
|
email: graemekh@gmail.com
|
32
|
-
executables:
|
33
|
-
|
24
|
+
executables:
|
25
|
+
- fastest
|
34
26
|
extensions: []
|
35
27
|
|
36
28
|
extra_rdoc_files:
|
37
29
|
- README
|
38
30
|
files:
|
39
31
|
- README
|
40
|
-
- bin/fastest
|
32
|
+
- bin/fastest
|
41
33
|
- lib/fas_test.rb
|
42
34
|
- test/fas_test_tests.rb
|
35
|
+
- fas_test.gemspec
|
43
36
|
has_rdoc: true
|
44
37
|
homepage: https://github.com/graeme-hill/fas_test
|
45
38
|
licenses: []
|