test/lolcommits/plugin/tranzlate_test.rb in lolcommits-tranzlate-0.0.3 vs test/lolcommits/plugin/tranzlate_test.rb in lolcommits-tranzlate-0.0.4

- old
+ new

@@ -8,11 +8,11 @@ it 'should have a name' do ::Lolcommits::Plugin::Tranzlate.name.must_equal 'tranzlate' end it 'should run on post capturing' do - ::Lolcommits::Plugin::Tranzlate.runner_order.must_equal [:precapture] + ::Lolcommits::Plugin::Tranzlate.runner_order.must_equal [:pre_capture] end describe 'with a runner' do def runner # a simple lolcommits runner with an empty configuration Hash @@ -20,11 +20,11 @@ config: OpenStruct.new(read_configuration: {}) ) end def plugin - @plugin ||= Lolcommits::Plugin::Tranzlate.new(runner) + @plugin ||= Lolcommits::Plugin::Tranzlate.new(runner: runner) end def valid_enabled_config @config ||= OpenStruct.new( read_configuration: { @@ -44,20 +44,20 @@ it 'should be false by default' do plugin.enabled?.must_equal false end it 'should true when configured' do - plugin.runner.config = valid_enabled_config + plugin.config = valid_enabled_config plugin.enabled?.must_equal true end end - describe '#run_precapture' do + describe '#run_pre_capture' do before { commit_repo_with_message('my awesome commit') } it 'should tranzlate the commit message' do - in_repo { plugin.run_precapture } - runner.message.must_match /AWESUM COMMIT/ + in_repo { plugin.run_pre_capture } + runner.message.must_match(/AWESUM COMMIT/) end after { teardown_repo } end end