ns-options 1.1.4 → 1.1.5

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.
@@ -49,7 +49,7 @@ module NsOptions::AssertMacros
49
49
 
50
50
  Assert::Macro.new(test_name) do
51
51
 
52
- should test_name do
52
+ should test_name, called_from do
53
53
 
54
54
  # have assertions
55
55
  assert subject.has_option?(opt_name)
@@ -99,7 +99,7 @@ module NsOptions
99
99
  else
100
100
  self.type_class.new(value, *self.rules[:args])
101
101
  end
102
- rescue Exception => err
102
+ rescue StandardError => err
103
103
  raise CoerceError.new(self.type_class, value, err)
104
104
  end
105
105
  end
@@ -1,3 +1,3 @@
1
1
  module NsOptions
2
- VERSION = "1.1.4"
2
+ VERSION = "1.1.5"
3
3
  end
@@ -114,6 +114,16 @@ class NsOptions::Namespace
114
114
  assert_included 'test/unit/namespace_tests.rb:', err.backtrace.first
115
115
  end
116
116
 
117
+ should "only raise CeorceError when StandardExceptions are raised writing values" do
118
+ subject.option('symbol', Symbol)
119
+
120
+ std_err_class = Class.new{ def to_sym; raise StandardError; end }
121
+ sig_err_class = Class.new{ def to_sym; raise SignalException, 'INT'; end }
122
+
123
+ assert_raises(NsOptions::Option::CoerceError){ subject.symbol = std_err_class.new }
124
+ assert_raises(SignalException){ subject.symbol = sig_err_class.new }
125
+ end
126
+
117
127
  end
118
128
 
119
129
  class NamespaceTests < BaseTests
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ns-options
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 4
10
- version: 1.1.4
9
+ - 5
10
+ version: 1.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Collin Redding
@@ -16,11 +16,12 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2013-05-02 00:00:00 Z
19
+ date: 2013-10-29 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
+ name: assert
22
23
  prerelease: false
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
24
+ requirement: &id001 !ruby/object:Gem::Requirement
24
25
  none: false
25
26
  requirements:
26
27
  - - ~>
@@ -30,9 +31,8 @@ dependencies:
30
31
  - 2
31
32
  - 0
32
33
  version: "2.0"
33
- requirement: *id001
34
- name: assert
35
34
  type: :development
35
+ version_requirements: *id001
36
36
  description: A DSL for defining, organizing and accessing options.
37
37
  email:
38
38
  - collin.redding@me.com
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  requirements: []
117
117
 
118
118
  rubyforge_project:
119
- rubygems_version: 1.8.15
119
+ rubygems_version: 1.8.24
120
120
  signing_key:
121
121
  specification_version: 3
122
122
  summary: A DSL for defining, organizing and accessing options.