Xregistry

Check-in [083d4a0378]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make corrections to gemspec and add additional tests.
Timelines: family | ancestors | descendants | both | trunk | version-1.3.9
Files: files | file ages | folders
SHA1:083d4a037860e05d1c2e7b455101046514da1c28
User & Date: wbp 2016-02-22 16:53:46
Context
2016-02-22
20:11
Add deleteEntry method, and store real values under Windows as strings. check-in: cae5eea66c user: wbp tags: trunk, version-1.4.0
16:53
Make corrections to gemspec and add additional tests. check-in: 083d4a0378 user: wbp tags: trunk, version-1.3.9
2016-02-21
03:32
Add tests for readBoolEntry, readRealEntry, writeBoolEntry, and writeRealEntry. check-in: 8538d16488 user: wbp tags: trunk, version-1.3.8
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to VERSION.

1
1.3.8
|
1
1.3.9

Changes to test/test_xregistry.rb.

1
2
3
4
5
6
7
8
9
..
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
# test program for wregistry gem
# Last modified:  20-Feb-2016

require 'xregistry'
require 'test/unit'

class TestWregistry < Test::Unit::TestCase
  def setup
    @@reg ||= Registry.new('testxreg', 'Wikareia')
................................................................................

    value = @@reg.readBoolEntry('Settings', 'bool_key1', false)
    assert_equal(false, value)
  end

  # test of readIntEntry
  def test_read_int_entry



    value = @@reg.readIntEntry('Settings', 'int_key1', 123)
    assert_equal(123, value)
  end

  # test of readRealEntry
  def test_read_real_entry



    value = @@reg.readRealEntry('Settings', 'real_key1', 12.5)
    assert_equal(12.5, value)
  end

  # test of readStringEntry
  def test_read_string_entry



    string = @@reg.readStringEntry('Settings', 'string_key1', 'default value')
    assert_match(/ value/, string)
  end

  # test of writeBoolEntry
  def test_write_bool_entry
    @@reg.writeBoolEntry('Settings', 'bool_key2', true)

|







 







>
>
>






>
>
>






>
>
>







1
2
3
4
5
6
7
8
9
..
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
# test program for wregistry gem
# Last modified:  21-Feb-2016

require 'xregistry'
require 'test/unit'

class TestWregistry < Test::Unit::TestCase
  def setup
    @@reg ||= Registry.new('testxreg', 'Wikareia')
................................................................................

    value = @@reg.readBoolEntry('Settings', 'bool_key1', false)
    assert_equal(false, value)
  end

  # test of readIntEntry
  def test_read_int_entry
    value = @@reg.readIntEntry('Settings', 'int_key1')
    assert_equal(0, value)

    value = @@reg.readIntEntry('Settings', 'int_key1', 123)
    assert_equal(123, value)
  end

  # test of readRealEntry
  def test_read_real_entry
    value = @@reg.readRealEntry('Settings', 'real_key1')
    assert_equal(0.0, value)

    value = @@reg.readRealEntry('Settings', 'real_key1', 12.5)
    assert_equal(12.5, value)
  end

  # test of readStringEntry
  def test_read_string_entry
    string = @@reg.readStringEntry('Settings', 'string_key1')
    assert_equal('', string)

    string = @@reg.readStringEntry('Settings', 'string_key1', 'default value')
    assert_match(/ value/, string)
  end

  # test of writeBoolEntry
  def test_write_bool_entry
    @@reg.writeBoolEntry('Settings', 'bool_key2', true)

Changes to xregistry.gemspec.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# xregistry.gemspec
# Last modified:  14-Feb-2016

spec = Gem::Specification.new do |s|
  s.name        = 'xregistry'
  s.version     = IO.read('VERSION')
  s.summary     = 'A cross-platform registry class for Ruby.'
  s.description = <<-EOS
This provides a cross-platform registry class for Ruby.
  EOS
  s.author      = 'William Parsons'
  s.email       = 'wbparsons@alum.mit.edu'
  s.license     = 'MIT'
  s.homepage    = 'http://chiselapp.com/user/varro/repository/Xregistry'
  s.files       = Dir['ext/**/*.{c,h,rb}'] +
                  Dir['{lib,test}/**/*.rb'] +
                  Dir['*.so'] +
                  %w[LICENSE Rakefile VERSION xregistry.gemspec]
end

|












|
<
<


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15


16
17
# xregistry.gemspec
# Last modified:  22-Feb-2016

spec = Gem::Specification.new do |s|
  s.name        = 'xregistry'
  s.version     = IO.read('VERSION')
  s.summary     = 'A cross-platform registry class for Ruby.'
  s.description = <<-EOS
This provides a cross-platform registry class for Ruby.
  EOS
  s.author      = 'William Parsons'
  s.email       = 'wbparsons@alum.mit.edu'
  s.license     = 'MIT'
  s.homepage    = 'http://chiselapp.com/user/varro/repository/Xregistry'
  s.files       = Dir['{lib,test}/*.rb'] +


                  %w[LICENSE Rakefile VERSION xregistry.gemspec]
end