spec/units/scrooge/framework/base_spec.rb in methodmissing-scrooge-1.0.1 vs spec/units/scrooge/framework/base_spec.rb in methodmissing-scrooge-1.0.2
- old
+ new
@@ -75,18 +75,19 @@
@base.stub!(:config).and_return( CONFIG )
@base.send( :ensure_scopes_path )
@signature = Time.now.to_i.to_s
FileUtils.mkdir_p( File.join( @base.scopes_path, @signature ) )
@base.scopes.should include( @signature )
+ FileUtils.rm_r( File.join( @base.scopes_path, @signature ) )
end
end
it "should be able to determine if there's any previously persisted scopes" do
with_rails do
@base.stub!(:config).and_return( CONFIG )
@base.send( :ensure_scopes_path )
- @base.scopes?().should eql( true )
+ @base.scopes?().should eql( false )
end
end
it "should be able to infer the path to a given scope" do
with_rails do
@@ -104,20 +105,21 @@
it "should be able to dump the current application tracker to a scope" do
with_rails do
@base.stub!(:config).and_return( CONFIG )
::Rails.stub!(:env).and_return( "test" )
- lambda{ @base.to_scope! }.should change( @base.scopes, :size )
+ @base.to_scope!()
+ @base.scopes.size.should == 1
end
end
it "should be able to restore a previous scope to the current app tracker" do
with_rails do
@base.stub!(:config).and_return( CONFIG )
::Rails.stub!(:env).and_return( "test" )
@scope = @base.to_scope!
- lambda{ @base.from_scope!( @scope ) }.should change( Scrooge::Base.profile.tracker, :object_id )
+ lambda{ Scrooge::Base.profile.scope = @base.from_scope!( @scope ) }.should change( Scrooge::Base.profile.tracker, :object_id )
end
end
it "should be able to validate previously saved scope signatures" do
@base.stub!(:scope?).and_return(false)
@@ -129,9 +131,13 @@
end
it "should be able to install tracking middleware" do
lambda{ @base.install_tracking_middleware() }.should raise_error( Scrooge::Framework::Base::NotImplemented )
end
+
+ it "should be able to uninstall tracking middleware" do
+ lambda{ @base.uninstall_tracking_middleware() }.should raise_error( Scrooge::Framework::Base::NotImplemented )
+ end
it "should be able to install scoping middleware" do
lambda{ @base.install_scope_middleware( 'tracker' ) }.should raise_error( Scrooge::Framework::Base::NotImplemented )
end
\ No newline at end of file