From 07aac886367508d7aa09636ce5d214a4cf0f34e2 Mon Sep 17 00:00:00 2001 From: Semyon Pupkov Date: Wed, 2 Mar 2016 12:23:12 +0500 Subject: [PATCH 1/5] feature: add helper for stub plugin into tests --- lib/treasury/spec_helpers.rb | 62 ++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 lib/treasury/spec_helpers.rb diff --git a/lib/treasury/spec_helpers.rb b/lib/treasury/spec_helpers.rb new file mode 100644 index 0000000..8452706 --- /dev/null +++ b/lib/treasury/spec_helpers.rb @@ -0,0 +1,62 @@ +module Treasury + module CoreDenormalizationFake + ROOT_REDIS_KEY = 'denormalization'.freeze + + module Processors + module Company + class Base + end + end + + module User + class Base + def interesting_event? + true + end + end + end + end + + module Fields + module User + class Base + end + + class Companies + end + end + + module Company + class Base + end + + class Translator + end + end + + class Base + end + end + end + + # Treasury::SpecHelpers provides method for stub plugin denormalization classes + # with fake class. + # + # Example: + # spec_helper.rb + # + # require 'treasury/spec_helpers' + # + # Treasury::SpecHelpers.stub_core_denormalization + # + # RSpec.configure do |config| + # ... + # end + module SpecHelpers + def stub_core_denormalization + Object.const_set('CoreDenormalization', CoreDenormalizationFake) + end + + module_function :stub_core_denormalization + end +end From c21355d47d6aa0e5c1dd3541c00c950824988b47 Mon Sep 17 00:00:00 2001 From: Semyon Pupkov Date: Wed, 2 Mar 2016 15:36:02 +0500 Subject: [PATCH 2/5] Release 0.1.0 --- CHANGELOG.md | 5 +++++ lib/treasury/version.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8531b46..aec6f1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ #### [Current] + * 2016-03-01 [863782b](../../commit/863782b) - __(Sergey Kucher)__ fix: customer new orders counter - fix treasury/processors/counters module in case when nothing changing + * 2016-03-02 [07aac88](../../commit/07aac88) - __(Semyon Pupkov)__ feature: add helper for stub plugin into tests + +#### v0.0.5 + * 2016-03-02 [8475cac](../../commit/8475cac) - __(Salahutdinov Dmitry)__ Release 0.0.5 * 2016-03-01 [8375263](../../commit/8375263) - __(Semyon Pupkov)__ feature: add base field and translators #### v0.0.4 diff --git a/lib/treasury/version.rb b/lib/treasury/version.rb index 1e03e51..4e01c78 100644 --- a/lib/treasury/version.rb +++ b/lib/treasury/version.rb @@ -1,3 +1,3 @@ module Treasury - VERSION = '0.0.5' + VERSION = '0.1.0' end From 2d4cf6f6f9fb7f6aeeafa739555aba23267b86b9 Mon Sep 17 00:00:00 2001 From: Semyon Pupkov Date: Wed, 2 Mar 2016 15:40:08 +0500 Subject: [PATCH 3/5] chore: use spec_helper instead internal class --- lib/treasury/spec_helpers.rb | 3 +++ spec/internal/lib/core_denormalization/processors/base.rb | 6 ------ spec/spec_helper.rb | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 spec/internal/lib/core_denormalization/processors/base.rb diff --git a/lib/treasury/spec_helpers.rb b/lib/treasury/spec_helpers.rb index 8452706..e9b6381 100644 --- a/lib/treasury/spec_helpers.rb +++ b/lib/treasury/spec_helpers.rb @@ -15,6 +15,9 @@ def interesting_event? end end end + + class Base + end end module Fields diff --git a/spec/internal/lib/core_denormalization/processors/base.rb b/spec/internal/lib/core_denormalization/processors/base.rb deleted file mode 100644 index 6534350..0000000 --- a/spec/internal/lib/core_denormalization/processors/base.rb +++ /dev/null @@ -1,6 +0,0 @@ -module CoreDenormalization - module Processors - class Base - end - end -end \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 082204c..4b8b743 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,4 +9,4 @@ require 'combustion' Combustion.initialize! -require_relative 'internal/lib/core_denormalization/processors/base' \ No newline at end of file +Treasury::SpecHelpers.stub_core_denormalization From 644a08067eccf778c96d4c2e3e5d2c26318957ec Mon Sep 17 00:00:00 2001 From: Sergey Kucher Date: Fri, 11 Mar 2016 16:02:21 +0500 Subject: [PATCH 4/5] chore: move methods from plugin into gem for processors base - #object - #no_action https://jira.railsc.ru/browse/PC4-15968 --- lib/treasury/processors/base.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/treasury/processors/base.rb b/lib/treasury/processors/base.rb index 2239e38..c864b23 100644 --- a/lib/treasury/processors/base.rb +++ b/lib/treasury/processors/base.rb @@ -3,6 +3,8 @@ module Treasury module Processors class Base < ::CoreDenormalization::Processors::Base + attr_accessor :object + def form_value(value) value end @@ -10,6 +12,10 @@ def form_value(value) def result_row(value) {@object => form_value(value)} end + + def no_action + nil + end end end end From d4640269adc515bfa5e28bcff63d902d4b400c95 Mon Sep 17 00:00:00 2001 From: Salahutdinov Dmitry Date: Fri, 11 Mar 2016 16:09:26 +0500 Subject: [PATCH 5/5] Release 0.2.0 --- CHANGELOG.md | 5 +++++ lib/treasury/version.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aec6f1f..d9a58ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ #### [Current] + * 2016-03-11 [644a080](../../commit/644a080) - __(Sergey Kucher)__ chore: move methods from plugin into gem for processors base - #object - #no_action https://jira.railsc.ru/browse/PC4-15968 + * 2016-03-02 [2d4cf6f](../../commit/2d4cf6f) - __(Semyon Pupkov)__ chore: use spec_helper instead internal class + +#### v0.1.0 + * 2016-03-02 [c21355d](../../commit/c21355d) - __(Semyon Pupkov)__ Release 0.1.0 * 2016-03-01 [863782b](../../commit/863782b) - __(Sergey Kucher)__ fix: customer new orders counter - fix treasury/processors/counters module in case when nothing changing * 2016-03-02 [07aac88](../../commit/07aac88) - __(Semyon Pupkov)__ feature: add helper for stub plugin into tests diff --git a/lib/treasury/version.rb b/lib/treasury/version.rb index 4e01c78..e5b1982 100644 --- a/lib/treasury/version.rb +++ b/lib/treasury/version.rb @@ -1,3 +1,3 @@ module Treasury - VERSION = '0.1.0' + VERSION = '0.2.0' end