rfm 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rfm.rb +228 -1
- data/lib/rfm_command.rb +562 -29
- data/lib/rfm_error.rb +241 -14
- data/lib/rfm_factory.rb +14 -7
- data/lib/rfm_result.rb +268 -11
- data/lib/rfm_util.rb +10 -0
- data/tests/rfm_test_errors.rb +53 -0
- data/tests/rfm_tester.rb +2 -0
- metadata +6 -4
data/lib/rfm_util.rb
ADDED
@@ -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
|
+
|
data/tests/rfm_tester.rb
ADDED
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.
|
7
|
-
date: 2007-
|
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:
|