rkh/rack-protection — pull request #87 by mdesantis (2014-09-03 17:53:33+00:00)
Title: Upgrade to RSpec 3 and major specs refactoring

Hello,

I'm planning to work a bit on rack-protection performance, so I cloned the project and I found the specs a bit cluttered; so I upgraded to RSpec 3 and did a cleanup.

These are my edits:

* 022f994: Convert RSpec syntax from RSpec 2 to RSpec 3 using the wonderful tool [Transpec](http://yujinakayama.me/transpec/)
* 2674740: Upgrade development dependency from RSpec 2 to RSpec 3
* de797ce: Move spec files from a flat spec/*_spec.rb pattern to the conventional pattern lib/folder/file.rb -> spec/lib/folder/file_spec.rb
* 01902df: Remove some define_methods on Struct.new classes in favour of `Struct.new do; def ... ; end` syntax
* 941fee8: Remove execution permissions to some spec files
* ed57eb2: Fix Ruby warnings visible using `rspec --warning`
* ecae614: Fix a test which implementation was previously broken (more on this later)
* 8196555: Remove unnedeed `require 'stringio'` line
* c5020a2: Reorganize spec directives which previously were collected in spec_helper.rb into relative spec/support/*.rb files
* a00a021: Generate rspec init default files with `rspec --init` and merge the previous ones into them
* 513abea: Remove `require 'spec_helper'` not needed anymore (because `.rspec` now includes `--require spec_helper` option)

The only change which involves a change to a test is ecae614: I replaced the previous incorrect use of `should` inside a define_method with a mock, and then realized that the test was broken, because the `changer` middleware was called *after* the `detector`; so I switched them and fixed the test.

I hope my changes to be appreciated :)