nera 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,6 +23,20 @@ class TC_NERA_SIM_RECS < Test::Unit::TestCase
23
23
  }
24
24
  end
25
25
 
26
+ def test_set_yaml_file
27
+ @db.set_yaml_file( 'simulators.yml')
28
+ assert( ! File.exist?( 'simulators.yml') )
29
+
30
+ @db.add(Ising)
31
+ assert( File.exist?( 'simulators.yml') )
32
+ loaded = YAML.load( File.open('simulators.yml','r') )
33
+
34
+ sleep 2
35
+ @db.touch(1)
36
+ loaded2 = YAML.load( File.open('simulators.yml','r') )
37
+ assert( loaded[0][:updated_at] < loaded2[0][:updated_at] )
38
+ end
39
+
26
40
  def test_create_table
27
41
  f = NERA::SimulatorRecords.create_table( @path_to_db)
28
42
  assert_equal( nil, f)
@@ -111,6 +125,21 @@ class TC_NERA_SIM_RECS < Test::Unit::TestCase
111
125
  assert_nil( flag)
112
126
  end
113
127
 
128
+ def test_update
129
+ add_three
130
+ sleep 3
131
+ flag = @db.update( 3)
132
+ assert_equal(true, flag)
133
+ r3 = @db.list[2]
134
+ assert( r3[:created_at] < r3[:updated_at])
135
+ r2 = @db.list[1]
136
+ assert( r2[:created_at] == r2[:updated_at])
137
+
138
+ # ------
139
+ flag = @db.update( 500)
140
+ assert_nil( flag)
141
+ end
142
+
114
143
  def test_destroy
115
144
  add_three
116
145
  r3 = @db.list[2]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nera
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yohsuke Murase
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-18 00:00:00 +09:00
12
+ date: 2009-05-24 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency