rack-pagespeed 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.4
@@ -21,7 +21,7 @@ module Rack::PageSpeed::Filters
21
21
  def requires_store
22
22
  instance_eval do
23
23
  def new options = {}
24
- options[:store] ? super(options) : false
24
+ options[:store] ? super(options) : raise("#{name} requires :store to be specified.")
25
25
  end
26
26
  end
27
27
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rack-pagespeed}
8
- s.version = "1.0.3"
8
+ s.version = "1.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Julio Cesar Ody"]
12
- s.date = %q{2011-01-24}
12
+ s.date = %q{2011-03-25}
13
13
  s.description = %q{Web page speed optimizations at the Rack level}
14
14
  s.email = %q{julio@awesomebydesign.com}
15
15
  s.extra_rdoc_files = [
@@ -83,12 +83,11 @@ describe 'rack-pagespeed configuration' do
83
83
  config.filters.count.should == 2
84
84
  end
85
85
 
86
- it "won't add a filter if it's call returns false" do
86
+ it "calling a filter that requires storage without specifying one raises an error" do
87
87
  class NeedsStore < Rack::PageSpeed::Filter
88
88
  requires_store
89
89
  end
90
- config = Rack::PageSpeed::Config.new do needs_store end
91
- config.filters.should be_empty
90
+ expect { Rack::PageSpeed::Config.new do needs_store end }.to raise_error
92
91
  end
93
92
 
94
93
  it 'raises a NoSuchFilter error when a non-existing filter is called ' do
@@ -6,7 +6,7 @@ describe 'the combine_css filter' do
6
6
  end
7
7
 
8
8
  it "requires a store mechanism to be passed via :store when initializing" do
9
- Rack::PageSpeed::Filters::CombineCSS.new.should be_false
9
+ expect { Rack::PageSpeed::Filters::CombineCSS.new }.to raise_error
10
10
  end
11
11
 
12
12
  it "is a priority 9 filter" do
@@ -10,8 +10,8 @@ describe 'the combine_javascripts filter' do
10
10
  end
11
11
 
12
12
  context "requires a store mechanism to be passed via :store when initializing" do
13
- specify { Rack::PageSpeed::Filters::CombineJavaScripts.new.should be_false }
14
- specify { Rack::PageSpeed::Filters::CombineJavaScripts.new(:store => {}).should_not be_false }
13
+ specify { expect { Rack::PageSpeed::Filters::CombineJavaScripts.new }.to raise_error }
14
+ specify { expect { Rack::PageSpeed::Filters::CombineJavaScripts.new(:store => {}) }.to_not raise_error }
15
15
  end
16
16
 
17
17
  context 'execute!' do
@@ -11,7 +11,7 @@ describe 'the base filter class' do
11
11
  class Moo < Rack::PageSpeed::Filter; end
12
12
  Rack::PageSpeed::Filters::Base.available_filters.should include(Moo)
13
13
  end
14
-
14
+
15
15
  context 'the #name declaration, which can be used to declare a name which the filter can be called upon' do
16
16
  it 'can be called from inside the class' do
17
17
  class Boo < Rack::PageSpeed::Filter
@@ -10,8 +10,8 @@ describe 'the minify_javascript filter' do
10
10
  end
11
11
 
12
12
  context "requires a storage mechanism to be passed via :store when initializing" do
13
- specify { Rack::PageSpeed::Filters::MinifyJavaScripts.new.should be_false }
14
- specify { Rack::PageSpeed::Filters::MinifyJavaScripts.new(:store => {}).should_not be_false }
13
+ specify { expect { Rack::PageSpeed::Filters::MinifyJavaScripts.new }.to raise_error }
14
+ specify { expect { Rack::PageSpeed::Filters::MinifyJavaScripts.new(:store => {}) }.to_not be_false }
15
15
  end
16
16
 
17
17
  context "#execute!" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-pagespeed
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
9
+ - 4
10
+ version: 1.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Julio Cesar Ody
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-24 00:00:00 +11:00
18
+ date: 2011-03-25 00:00:00 +11:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency