filigree 0.3.3 → 0.4.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.
@@ -1,7 +1,7 @@
1
- # Author: Chris Wailes <chris.wailes@gmail.com>
2
- # Project: Filigree
3
- # Date: 2013/05/04
4
- # Description: Test cases for the Object extensions.
1
+ # Author: Chris Wailes <chris.wailes+filigree@gmail.com>
2
+ # Project: Filigree
3
+ # Date: 2013/05/04
4
+ # Description: Test cases for the Object extensions.
5
5
 
6
6
  ############
7
7
  # Requires #
@@ -18,11 +18,10 @@ require 'filigree/object'
18
18
  #######################
19
19
 
20
20
  class ObjectTester < Minitest::Test
21
- Foo = Struct.new :a, :b
22
21
 
23
- def setup
22
+ using Filigree
24
23
 
25
- end
24
+ Foo = Struct.new :a, :b
26
25
 
27
26
  def test_returning
28
27
  assert( returning(true) { false } )
@@ -1,7 +1,7 @@
1
- # Author: Chris Wailes <chris.wailes@gmail.com>
2
- # Project: Filigree
3
- # Date: 2014/02/05
4
- # Description: Test cases for the String extensions.
1
+ # Author: Chris Wailes <chris.wailes+filigree@gmail.com>
2
+ # Project: Filigree
3
+ # Date: 2014/02/05
4
+ # Description: Test cases for the String extensions.
5
5
 
6
6
  ############
7
7
  # Requires #
@@ -19,6 +19,8 @@ require 'filigree/string'
19
19
 
20
20
  class ObjectTester < Minitest::Test
21
21
 
22
+ using Filigree
23
+
22
24
  ORIGINAL = 'Hello, I am a test string. I am really long so that the string segmentation code can be tested.'
23
25
  SEGMENTED = <<eos
24
26
  Hello, I am a test string.
@@ -1,4 +1,4 @@
1
- # Author: Chris Wailes <chris.wailes@gmail.com>
1
+ # Author: Chris Wailes <chris.wailes+filigree@gmail.com>
2
2
  # Project: Filigree
3
3
  # Date: 2013/05/04
4
4
  # Description: Test cases for type checking.
@@ -40,7 +40,7 @@ class TypeTester < Minitest::Test
40
40
  include Filigree::TypedClass
41
41
 
42
42
  typed_ivar :foo, Integer
43
- typed_ivar :bar, String, true
43
+ typed_ivar :bar, String, nillable: true
44
44
 
45
45
  default_constructor
46
46
  end
@@ -61,42 +61,42 @@ class TypeTester < Minitest::Test
61
61
  def test_check_type
62
62
  assert check_type([], Array)
63
63
 
64
- assert check_type(1, Fixnum)
65
- assert check_type(nil, Fixnum, nil, true).nil?
66
- assert check_type(1, Fixnum, nil, false, true)
67
- assert check_type(nil, Fixnum, nil, true, true).nil?
68
- assert check_type(1, Integer)
64
+ assert check_type(1, Integer)
65
+ assert check_type(nil, Integer, nillable: true).nil?
66
+ assert check_type(1, Integer, strict: true)
67
+ assert check_type(nil, Integer, nillable: true, strict: true).nil?
69
68
 
70
- assert_raises(TypeError) { check_type(1, Integer, nil, false, true) }
69
+ assert_raises(TypeError) { check_type(1, Numeric, strict: true) }
71
70
  assert_raises(TypeError) { check_type(1, Array) }
72
71
  end
73
72
 
74
73
  def test_check_array_type
75
- assert check_array_type([1, 2, 3], Fixnum)
76
- assert check_array_type([1, 2, 3], Fixnum, nil, true)
77
- assert check_array_type([1, 2, 3], Integer)
78
-
79
- assert_raises(TypeError) { check_array_type([1, 2, 3], Integer, nil, false, true) }
80
- assert_raises(TypeError) { check_array_type([1, :hello, 'world'], Fixnum) }
81
- assert_raises(TypeError) { check_array_type([1, 2, 3], Float, 'foo') }
74
+ assert check_array_type([1, 2, 3], Integer)
75
+ assert check_array_type([1, 2, 3, nil], Integer, nillable: true)
76
+ assert check_array_type([1, 2, 3], Integer, strict: true)
77
+ assert check_array_type([1, 2, 3, nil], Integer, nillable: true, strict: true)
78
+
79
+ assert_raises(TypeError) { check_array_type([1, 2, 3], Numeric, strict: true) }
80
+ assert_raises(TypeError) { check_array_type([1, :hello, 'world'], Integer) }
81
+ assert_raises(TypeError) { check_array_type([1, 2, 3], Float, blame: 'foo') }
82
82
  end
83
83
 
84
84
  def test_default_constructor
85
85
  v0 = Bar.new(1, 'hello')
86
86
 
87
- assert_equal 1, v0.foo
87
+ assert_equal 1, v0.foo
88
88
  assert_equal 'hello', v0.bar
89
89
 
90
90
  v1 = Baf.new(2)
91
91
 
92
92
  assert_equal 2, v1.foo
93
- assert_nil v1.bar
93
+ assert_nil v1.bar
94
94
 
95
95
  assert_raises(ArgumentError) { Baz.new(3) }
96
96
 
97
97
  v2 = Baz.new(2, 'world')
98
98
 
99
- assert_equal 2, v2.foo
99
+ assert_equal 2, v2.foo
100
100
  assert_equal 'world', v2.bar
101
101
  end
102
102
 
@@ -107,7 +107,7 @@ class TypeTester < Minitest::Test
107
107
  v0.bar = 'hello'
108
108
  v0.baf = [1,2,3]
109
109
 
110
- assert_equal 1, v0.foo
110
+ assert_equal 1, v0.foo
111
111
  assert_equal 'hello', v0.bar
112
112
  assert_equal [1,2,3], v0.baf
113
113
 
@@ -1,4 +1,4 @@
1
- # Author: Chris Wailes <chris.wailes@gmail.com>
1
+ # Author: Chris Wailes <chris.wailes+filigree@gmail.com>
2
2
  # Project: Filigree
3
3
  # Date: 2014/02/11
4
4
  # Description: Test cases for the Visitor module.
@@ -19,6 +19,8 @@ require 'filigree/visitor'
19
19
 
20
20
  class VisitorTester < Minitest::Test
21
21
 
22
+ using Filigree
23
+
22
24
  ####################
23
25
  # Internal Classes #
24
26
  ####################
@@ -86,7 +88,7 @@ class VisitorTester < Minitest::Test
86
88
  two
87
89
  end
88
90
 
89
- on /three/ do
91
+ on(/three/) do
90
92
  :three
91
93
  end
92
94
 
@@ -124,7 +126,7 @@ class VisitorTester < Minitest::Test
124
126
  @total = 0
125
127
  end
126
128
 
127
- on(Foo.(Fixnum.as n)) do
129
+ on(Foo.(Integer.as n)) do
128
130
  @total += n
129
131
  end
130
132
  end
@@ -138,7 +140,7 @@ class VisitorTester < Minitest::Test
138
140
  @total = 1
139
141
  end
140
142
 
141
- on(Foo.(Fixnum.as n)) do
143
+ on(Foo.(Integer.as n)) do
142
144
  @total *= n
143
145
  end
144
146
  end
@@ -1,8 +1,8 @@
1
- # Author: Chris Wailes <chris.wailes@gmail.com>
2
- # Project: Filigree
3
- # Date: 2013/04/19
4
- # Description: This file contains the test suit for Filigree. It requires the
5
- # individual tests from their respective files.
1
+ # Author: Chris Wailes <chris.wailes+filigree@gmail.com>
2
+ # Project: Filigree
3
+ # Date: 2013/04/19
4
+ # Description: This file contains the test suit for Filigree. It requires the
5
+ # individual tests from their respective files.
6
6
 
7
7
  ############
8
8
  # Requires #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filigree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wailes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-05 00:00:00.000000000 Z
11
+ date: 2017-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: 0.8.1
159
+ version: 0.9.9
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: 0.8.1
166
+ version: 0.9.9
167
167
  description: Filigree provides new classes and extensions to core library classes
168
168
  that add functionality to Ruby.
169
169
  email: chris.wailes+filigree@gmail.com
@@ -215,7 +215,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
215
  requirements:
216
216
  - - ">="
217
217
  - !ruby/object:Gem::Version
218
- version: 2.0.0
218
+ version: 2.4.0
219
219
  required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  requirements:
221
221
  - - ">="
@@ -223,22 +223,21 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  version: '0'
224
224
  requirements: []
225
225
  rubyforge_project:
226
- rubygems_version: 2.2.2
226
+ rubygems_version: 2.6.13
227
227
  signing_key:
228
228
  specification_version: 4
229
229
  summary: Extra functionality for Ruby.
230
230
  test_files:
231
- - test/tc_commands.rb
231
+ - test/tc_boolean.rb
232
+ - test/tc_object.rb
232
233
  - test/tc_types.rb
233
- - test/tc_class.rb
234
+ - test/tc_configuration.rb
235
+ - test/tc_commands.rb
234
236
  - test/tc_string.rb
235
- - test/tc_application.rb
236
- - test/tc_match.rb
237
237
  - test/tc_abstract_class.rb
238
- - test/tc_object.rb
239
- - test/tc_class_methods_module.rb
240
- - test/tc_configuration.rb
241
- - test/tc_boolean.rb
242
238
  - test/tc_visitor.rb
239
+ - test/tc_class_methods_module.rb
240
+ - test/tc_match.rb
241
+ - test/tc_class.rb
242
+ - test/tc_application.rb
243
243
  - test/ts_filigree.rb
244
- has_rdoc: