rfm 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ module Rfm::Util # :nodoc: all
2
+ class CaseInsensitiveHash < Hash
3
+ def []=(key, value)
4
+ super(key.downcase, value)
5
+ end
6
+ def [](key)
7
+ super(key.downcase)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,53 @@
1
+ require 'test/unit'
2
+ require '../lib/rfm'
3
+
4
+ # Test cases for testing the FileMakerError classes
5
+ #
6
+ # Author:: Mufaddal Khumri
7
+ # Copyright:: Copyright (c) 2007 Six Fried Rice, LLC and Mufaddal Khumri
8
+ # License:: See MIT-LICENSE for details
9
+ class TC_TestErrors < Test::Unit::TestCase
10
+
11
+ def test_default_message_system_errors
12
+ begin
13
+ raise Rfm::Error::FileMakerError.getError(0)
14
+ rescue Rfm::Error::SystemError => ex
15
+ assert_equal(ex.message, 'SystemError occurred.')
16
+ assert_equal(ex.code, 0)
17
+ end
18
+ end
19
+
20
+ def test_scriptmissing_errors
21
+ begin
22
+ raise Rfm::Error::FileMakerError.getError(104, 'ScriptMissingError occurred.')
23
+ rescue Rfm::Error::MissingError => ex
24
+ assert_equal(ex.code, 104)
25
+ end
26
+ end
27
+
28
+ def test_rangevalidation_errors
29
+ begin
30
+ raise Rfm::Error::FileMakerError.getError(503, 'RangeValidationError occurred.')
31
+ rescue Rfm::Error::ValidationError => ex
32
+ assert_equal(ex.code, 503)
33
+ end
34
+ end
35
+
36
+ def test_one_unknown_errors
37
+ begin
38
+ raise Rfm::Error::FileMakerError.getError(-1, 'UnknownError occurred.')
39
+ rescue Rfm::Error::UnknownError => ex
40
+ assert_equal(ex.code, -1)
41
+ end
42
+ end
43
+
44
+ def test_two_unknown_errors
45
+ begin
46
+ raise Rfm::Error::FileMakerError.getError(99999, 'UnknownError occurred.')
47
+ rescue Rfm::Error::UnknownError => ex
48
+ assert_equal(ex.code, 99999)
49
+ end
50
+ end
51
+
52
+ end
53
+
@@ -0,0 +1,2 @@
1
+ require 'test/unit'
2
+ require 'rfm_test_errors'
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: rfm
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.0
7
- date: 2007-06-23 00:00:00 -07:00
6
+ version: 1.0.0
7
+ date: 2007-07-10 00:00:00 -07:00
8
8
  summary: A package to access FileMaker Pro databases
9
9
  require_paths:
10
10
  - lib
@@ -34,9 +34,11 @@ files:
34
34
  - lib/rfm_error.rb
35
35
  - lib/rfm_factory.rb
36
36
  - lib/rfm_result.rb
37
+ - lib/rfm_util.rb
37
38
  - README
38
- test_files: []
39
-
39
+ test_files:
40
+ - tests/rfm_test_errors.rb
41
+ - tests/rfm_tester.rb
40
42
  rdoc_options: []
41
43
 
42
44
  extra_rdoc_files: