active_interaction 2.1.0 → 2.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eac224974be5bdaafca02a1266a62b5a7d18e835
4
- data.tar.gz: f6224fbee6808c51696a42af86a4138d20d6bd56
3
+ metadata.gz: 6f1a6360b50ccffdcd40231df37ef50ba71e0513
4
+ data.tar.gz: 053934f4e4c53b81cf72e4843d3c00a4023890e3
5
5
  SHA512:
6
- metadata.gz: b816a2a4b4c463e5cc208862950d5b789c4d20c70df9a2cb98c7a8013b78a734426709d5e08587d2daea14034860521fb6286893e45c05418fab08331e3076be
7
- data.tar.gz: fa0ec07a406a4c4d8c0d22270abaf05e2eb17bb3bd64a1590112fcca26649817a08aa48ad25f6785fc7caefd1e835eed14e4b4a8d613587cc4bb9f841c173e95
6
+ metadata.gz: 17b08e4252eaed06870d0fb1c7f3993830a9a939e10f69357d0fcda7f02d0965e52e3fae6e99632077217176475c90d04526caa196d489c5618b5df4c33899f0
7
+ data.tar.gz: 21ba7fdaa0139290a77a85e4617cbeccd1194b25fa6fec02574a185866c8a93b5758953bee8db769216818f7987afd42fea34d3a264a6aa01a25f45e8bfc1c03
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [2.1.1][] (2015-08-04)
2
+
3
+ ## Fixed
4
+
5
+ - [#296][]: Fixed a bug that silently converted invalid lazy default values to
6
+ `nil` instead of raising an `InvalidDefaultError`.
7
+
1
8
  # [2.1.0][] (2015-07-30)
2
9
 
3
10
  ## Added
@@ -430,6 +437,7 @@ For help upgrading to version 2, please read [the announcement post][].
430
437
 
431
438
  - Initial release.
432
439
 
440
+ [2.1.1]: https://github.com/orgsync/active_interaction/compare/v2.1.0...v2.1.1
433
441
  [2.1.0]: https://github.com/orgsync/active_interaction/compare/v2.0.1...v2.1.0
434
442
  [2.0.1]: https://github.com/orgsync/active_interaction/compare/v2.0.0...v2.0.1
435
443
  [2.0.0]: https://github.com/orgsync/active_interaction/compare/v1.6.0...v2.0.0
@@ -565,5 +573,6 @@ For help upgrading to version 2, please read [the announcement post][].
565
573
  [#286]: https://github.com/orgsync/active_interaction/issues/286
566
574
  [#289]: https://github.com/orgsync/active_interaction/issues/289
567
575
  [#295]: https://github.com/orgsync/active_interaction/issues/295
576
+ [#296]: https://github.com/orgsync/active_interaction/issues/296
568
577
 
569
578
  [the announcement post]: http://devblog.orgsync.com/2015/05/06/announcing-active-interaction-2/
@@ -9,7 +9,7 @@ require 'active_model'
9
9
  #
10
10
  # @since 1.0.0
11
11
  #
12
- # @version 2.1.0
12
+ # @version 2.1.1
13
13
  module ActiveInteraction
14
14
  end
15
15
 
@@ -248,7 +248,7 @@ module ActiveInteraction
248
248
  self.class.filters.each do |name, filter|
249
249
  begin
250
250
  public_send("#{name}=", filter.clean(inputs[name]))
251
- rescue Error
251
+ rescue InvalidValueError, MissingValueError, NoDefaultError
252
252
  # #type_check will add errors if appropriate.
253
253
  end
254
254
  end
@@ -5,5 +5,5 @@ module ActiveInteraction
5
5
  # The version number.
6
6
  #
7
7
  # @return [Gem::Version]
8
- VERSION = Gem::Version.new('2.1.0')
8
+ VERSION = Gem::Version.new('2.1.1')
9
9
  end
@@ -2,15 +2,15 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- class InteractionWithFilter < TestInteraction
5
+ InteractionWithFilter = Class.new(TestInteraction) do
6
6
  float :thing
7
7
  end
8
8
 
9
- class InteractionWithDateFilter < TestInteraction
9
+ InteractionWithDateFilter = Class.new(TestInteraction) do
10
10
  date :thing
11
11
  end
12
12
 
13
- class AddInteraction < TestInteraction
13
+ AddInteraction = Class.new(TestInteraction) do
14
14
  float :x, :y
15
15
 
16
16
  def execute
@@ -18,7 +18,7 @@ class AddInteraction < TestInteraction
18
18
  end
19
19
  end
20
20
 
21
- class InterruptInteraction < TestInteraction
21
+ InterruptInteraction = Class.new(TestInteraction) do
22
22
  object :x, :y,
23
23
  class: Object,
24
24
  default: nil
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- class InteractionWithFloatFilter < TestInteraction
5
+ InteractionWithFloatFilter = Class.new(TestInteraction) do
6
6
  float :thing
7
7
  end
8
8
 
@@ -12,7 +12,7 @@ describe ActiveInteraction do
12
12
  end
13
13
  end
14
14
 
15
- class I18nInteraction < TestInteraction
15
+ I18nInteraction = Class.new(TestInteraction) do
16
16
  hash :a do
17
17
  hash :x
18
18
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- class ArrayInteraction < TestInteraction
5
+ ArrayInteraction = Class.new(TestInteraction) do
6
6
  array :a do
7
7
  array
8
8
  end
@@ -3,7 +3,7 @@
3
3
  require 'spec_helper'
4
4
  require 'action_dispatch'
5
5
 
6
- class FileInteraction < TestInteraction
6
+ FileInteraction = Class.new(TestInteraction) do
7
7
  file :a
8
8
  end
9
9
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- class HashInteraction < TestInteraction
5
+ HashInteraction = Class.new(TestInteraction) do
6
6
  hash :a do
7
7
  hash :x
8
8
  end
@@ -4,7 +4,7 @@ require 'spec_helper'
4
4
  require 'json'
5
5
  require 'yaml'
6
6
 
7
- class InterfaceInteraction < TestInteraction
7
+ InterfaceInteraction = Class.new(TestInteraction) do
8
8
  interface :anything
9
9
  end
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- class ObjectInteraction < TestInteraction
5
+ ObjectInteraction = Class.new(TestInteraction) do
6
6
  object :object
7
7
  end
8
8
 
@@ -25,7 +25,7 @@ TimeWithZone = Class.new do
25
25
  end
26
26
  end
27
27
 
28
- class TimeInteraction < TestInteraction
28
+ TimeInteraction = Class.new(TestInteraction) do
29
29
  time :a
30
30
  end
31
31
 
@@ -30,6 +30,19 @@ shared_examples_for 'an interaction' do |type, generator, filter_options = {}|
30
30
  end
31
31
  end
32
32
 
33
+ context 'with an invalid lazy default' do
34
+ let(:described_class) do
35
+ Class.new(TestInteraction) do
36
+ public_send(type, :default,
37
+ filter_options.merge(default: -> { Object.new }))
38
+ end
39
+ end
40
+
41
+ it 'raises an error' do
42
+ expect { outcome }.to raise_error ActiveInteraction::InvalidDefaultError
43
+ end
44
+ end
45
+
33
46
  context 'without required inputs' do
34
47
  it 'is invalid' do
35
48
  expect(outcome).to be_invalid
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_interaction
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Lasseigne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-30 00:00:00.000000000 Z
12
+ date: 2015-08-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel