option_initializer 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module OptionInitializer
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
@@ -2,6 +2,9 @@ require "option_initializer/version"
2
2
 
3
3
  module OptionInitializer
4
4
  def validate_options options
5
+ raise TypeError,
6
+ "wrong argument type #{options.class} (expected Hash)" unless
7
+ options.is_a?(Hash)
5
8
  return if options.respond_to?(:option_validated?)
6
9
  validators = self.class.const_get(:OptionInitializing).const_get(:VALIDATORS)
7
10
  validators.each do |validator|
@@ -139,6 +139,8 @@ class TestOptionInitializer < MiniTest::Unit::TestCase
139
139
  MyClass2.reset_count
140
140
  MyClass2.new :aaa => 1, :bbb => 2
141
141
  assert_equal 4, MyClass2.count
142
+
143
+ assert_raises(TypeError) { MyClass2.new 'str' }
142
144
  end
143
145
 
144
146
  def test_readme
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: option_initializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-27 00:00:00.000000000 Z
12
+ date: 2013-03-02 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Object construction with method chaining
15
15
  email:
@@ -47,10 +47,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
47
  version: '0'
48
48
  requirements: []
49
49
  rubyforge_project:
50
- rubygems_version: 1.8.24
50
+ rubygems_version: 1.8.25
51
51
  signing_key:
52
52
  specification_version: 3
53
53
  summary: Object construction with method chaining
54
54
  test_files:
55
55
  - test/test_option_initializer.rb
56
- has_rdoc: