spec/middleware_spec.rb in rack-reducer-0.1.1 vs spec/middleware_spec.rb in rack-reducer-0.1.2
- old
+ new
@@ -7,10 +7,11 @@
DEFAULTS = {
dataset: DB[:artists].all,
filters: [
->(genre:) { select { |item| item[:genre].match(/#{genre}/i) } },
->(name:) { select { |item| item[:name].match(/#{name}/i) } },
- ->(order:) { sort_by { |item| item[order.to_sym] } }
+ ->(order:) { sort_by { |item| item[order.to_sym] } },
+ ->(releases:) { select { |item| item[:release_count] == releases.to_i } },
]
}
def self.app(options = {}, key = options[:key] || 'rack.reduction')
Rack::Builder.new do