envato / event_sourcery

A library for building event sourced applications in Ruby
MIT License
84 stars 10 forks source link

Fix a few issues identified by MRI. #74

Closed orien closed 7 years ago

orien commented 8 years ago

Running the test suite with Ruby's -w option spits out a few warnings. Mostly sequel issues, but there are a few caused by EventSourcery. Here's a go at fixing them.

FYI: here are the issues as raised.

/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_trackers/postgres.rb:24: warning: assigned but unused variable - rows_changed
/Users/orien/src/event_sourcery/lib/event_sourcery/config.rb:53: warning: method redefined; discarding old projections_database=
/Users/orien/src/event_sourcery/spec/event_sourcery/command/aggregate_root_spec.rb:6: warning: circular argument reference - use_optimistic_concurrency
/Users/orien/src/event_sourcery/spec/event_sourcery/event_store/event_source_spec.rb:16: warning: assigned but unused variable - result
/Users/orien/src/event_sourcery/.bundle/ruby/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/memoized_helpers.rb:288: warning: method redefined; discarding old aggregate_id
/Users/orien/src/event_sourcery/spec/event_sourcery/event_store/postgres/connection_with_optimistic_concurrency_spec.rb:4: warning: previous definition of aggregate_id was here
/Users/orien/src/event_sourcery/.bundle/ruby/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/memoized_helpers.rb:295: warning: method redefined; discarding old aggregate_id
/Users/orien/src/event_sourcery/.bundle/ruby/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/memoized_helpers.rb:295: warning: previous definition of aggregate_id was here
/Users/orien/src/event_sourcery/lib/event_sourcery/config.rb:34: warning: instance variable @event_store_database not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/config.rb:41: warning: instance variable @event_store not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/config.rb:34: warning: instance variable @event_store_database not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/config.rb:41: warning: instance variable @event_store not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:64: warning: instance variable @processor_name not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:64: warning: instance variable @processor_name not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:43: warning: instance variable @processes_event_types not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:43: warning: instance variable @processes_event_types not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:43: warning: instance variable @processes_event_types not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:43: warning: instance variable @processes_event_types not initialized
WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives, since literally any other error would cause the expectation to pass, including those raised by Ruby (e.g. NoMethodError, NameError and ArgumentError), meaning the code you are intending to test may not even get reached. Instead consider using `expect {}.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/orien/src/event_sourcery/spec/event_sourcery/event_processing/reactor_spec.rb:74:in `block (3 levels) in <top (required)>'.
WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives, since literally any other error would cause the expectation to pass, including those raised by Ruby (e.g. NoMethodError, NameError and ArgumentError), meaning the code you are intending to test may not even get reached. Instead consider using `expect {}.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/orien/src/event_sourcery/spec/event_sourcery/event_processing/reactor_spec.rb:80:in `block (3 levels) in <top (required)>'.
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:64: warning: instance variable @processor_name not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:64: warning: instance variable @processor_name not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:64: warning: instance variable @processor_name not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:64: warning: instance variable @processor_name not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:64: warning: instance variable @processor_name not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:64: warning: instance variable @processor_name not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:64: warning: instance variable @processor_name not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:64: warning: instance variable @processor_name not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:64: warning: instance variable @processor_name not initialized
/Users/orien/src/event_sourcery/lib/event_sourcery/event_processing/event_stream_processor.rb:64: warning: instance variable @processor_name not initialized