Sha256: 11320884258918853e1ed0e6554f8521524a4ad8b55fa68935c4118f42efd734
Contents?: true
Size: 671 Bytes
Versions: 7
Compression:
Stored size: 671 Bytes
Contents
require 'spec_helper' require 'copy_tuner_client/helper_extension' require 'copy_tuner_client/copyray' describe CopyTunerClient::HelperExtension do module KeywordArgumentsHelper def translate(key, **options) "Hello, #{options[:name]}" end def controller nil end end class KeywordArgumentsView include KeywordArgumentsHelper end CopyTunerClient::HelperExtension.hook_translation_helper(KeywordArgumentsHelper, middleware_enabled: true) it 'works with keyword argument method' do view = KeywordArgumentsView.new expect(view.translate('some.key', name: 'World')).to eq '<!--COPYRAY some.key-->Hello, World' end end
Version data entries
7 entries across 7 versions & 1 rubygems