From 2d0ff135846363e2baf00d43049b4e9fc4e70c47 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Fri, 16 Mar 2012 19:03:58 +0100 Subject: Whitespace cleanup --- lib/bacon.rb | 6 +++--- test/spec_bacon.rb | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/bacon.rb b/lib/bacon.rb index 45d4bf8..abd52c1 100644 --- a/lib/bacon.rb +++ b/lib/bacon.rb @@ -132,13 +132,13 @@ module Bacon class Context attr_reader :name, :block - + def initialize(name, &block) @name = name @before, @after = [], [] @block = block end - + def run return unless name =~ RestrictContext Counter[:context_depth] += 1 @@ -160,7 +160,7 @@ module Bacon Counter[:specifications] += 1 run_requirement description, block end - + def should(*args, &block) if Counter[:depth]==0 it('should '+args.first,&block) diff --git a/test/spec_bacon.rb b/test/spec_bacon.rb index 1d2a7d3..57e3842 100644 --- a/test/spec_bacon.rb +++ b/test/spec_bacon.rb @@ -27,7 +27,7 @@ end describe "Bacon" do extend MetaTests - + it "should have should.satisfy" do lambda { should.satisfy { 1 == 1 } }.should succeed lambda { should.satisfy { 1 } }.should succeed @@ -96,7 +96,7 @@ describe "Bacon" do ex.should.be.kind_of RuntimeError ex.message.should =~ /foo/ end - + it "should have should.be.an.instance_of" do lambda { "string".should.be.instance_of String }.should succeed lambda { "string".should.be.instance_of Hash }.should fail @@ -149,7 +149,7 @@ describe "Bacon" do }.should.not.raise(RuntimeError, Comparable) }.should.raise ZeroDivisionError }.should succeed - + lambda { lambda { raise "Error" }.should.not.raise }.should fail end @@ -193,7 +193,7 @@ describe "Bacon" do lambda { 5.should.respond_to :to_str }.should fail lambda { :foo.should.respond_to :nx }.should fail end - + it "should have should.be.close" do lambda { 1.4.should.be.close 1.4, 0 }.should succeed lambda { 0.4.should.be.close 0.5, 0.1 }.should succeed @@ -290,40 +290,40 @@ describe "before/after" do after do @a.should.equal 3 end - + it "should run in the right order" do @a.should.equal 2 @b.should.equal 2 end - + describe "when nested" do before do @c = 5 end - + it "should run from higher level" do @a.should.equal 2 @b.should.equal 2 end - + it "should run at the nested level" do @c.should.equal 5 end - + before do @a = 5 end - + it "should run in the right order" do @a.should.equal 5 @a = 2 end end - + it "should not run from lower level" do @c.should.be.nil end - + describe "when nested at a sibling level" do it "should not run from sibling level" do @c.should.be.nil @@ -391,7 +391,7 @@ describe 'describe arguments' do it 'should work with symbols' do check(describe(:behaviour) {},'behaviour') end - + it 'should work with modules' do check(describe(Bacon) {},'Bacon') end -- cgit 1.4.1