Dex 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/Dex.rb +1 -1
- data/lib/Dex/version.rb +1 -1
- data/spec/Dex.rb +25 -3
- data/spec/libs/main.rb +4 -0
- metadata +1 -1
data/README.md
CHANGED
data/lib/Dex.rb
CHANGED
data/lib/Dex/version.rb
CHANGED
data/spec/Dex.rb
CHANGED
@@ -2,15 +2,37 @@
|
|
2
2
|
describe "Dex :db" do
|
3
3
|
|
4
4
|
it "resets :table to nil after specifying a new Database" do
|
5
|
-
t =
|
6
|
-
include Dex::DSL
|
7
|
-
}.new
|
5
|
+
t = new_dex
|
8
6
|
t.db "/tmp/db.test.1.db"
|
9
7
|
t.table.count
|
10
8
|
t.db "/tmp/db.test.2.db"
|
11
9
|
t.instance_eval { @table }.should.be == nil
|
12
10
|
end
|
13
11
|
|
12
|
+
it "allows file names with underscores: my_log.db" do
|
13
|
+
file = 'my_log.db'
|
14
|
+
begin
|
15
|
+
should.not.raise {
|
16
|
+
db = new_dex
|
17
|
+
db.db file
|
18
|
+
}
|
19
|
+
ensure
|
20
|
+
File.unlink file if File.exists?(file)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "allows relative file names" do
|
25
|
+
file = './my_log.db'
|
26
|
+
begin
|
27
|
+
should.not.raise {
|
28
|
+
db = new_dex
|
29
|
+
db.db file
|
30
|
+
}
|
31
|
+
ensure
|
32
|
+
File.unlink file if File.exists?(file)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
14
36
|
end # === Dex :db
|
15
37
|
|
16
38
|
describe "Dex :recent" do
|
data/spec/libs/main.rb
CHANGED