<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,38 +1,36 @@
 require 'stack'
 describe Stack do
-  it &quot;should be empty when first created&quot; do
-    Stack.new.should be_empty
+  before { @stack = Stack.new }
+
+  describe &quot;before pushing&quot; do
+    subject { @stack }
+    it { should be_empty }
+    it &quot;should return nil when popping&quot; do
+      subject.pop.should be_nil
+    end
   end
   
-  it &quot;should not be empty when something is pushed onto it&quot; do
-    stack = Stack.new
-    stack.push(1)
-    stack.should_not be_empty
+  describe &quot;after one push&quot; do
+    before { @stack.push(&quot;Hello, world&quot;) }
+    subject { @stack }
+    it { should_not be_empty }
+    it { should have(1).items }
+    it &quot;should return item when popped&quot; do
+      subject.pop.should == &quot;Hello, world&quot;
+    end
   end
-
-  it &quot;size should be incremented by 1 when something is pushed onto it&quot; do
+  
+  it &quot;should increment size by 1 when pushing&quot; do
     stack = Stack.new
     lambda{
       stack.push(&quot;Hello World!&quot;)
     }.should change(stack, :size).by(1)
   end
 
-  it &quot;result should be saved in var when something is pop'ed from it&quot; do
-    stack = Stack.new
-    stack.push(&quot;mooh&quot;)
-    stack.pop.should == &quot;mooh&quot;
-  end
-
-  it &quot;pop from empty stack should give nil&quot; do
-    stack = Stack.new
-    stack.pop.should == nil
-  end
-
-  it &quot;size should be decremented by 1 when something is pop'ed from it&quot; do
-    stack = Stack.new
-    stack.push(&quot;Office&quot;)
+  it &quot;should decrement size by 1 when popping&quot; do
+    @stack.push(&quot;Office&quot;)
     lambda{
-      stack.pop
-    }.should change(stack, :size).by(-1)
+      @stack.pop
+    }.should change(@stack, :size).by(-1)
   end
 end
\ No newline at end of file</diff>
      <filename>spec/stack_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1a428c40d9e50462a9221bdcd573a6f8612e5464</id>
    </parent>
  </parents>
  <author>
    <name>Jacob Atzen</name>
    <email>jacob@jacobatzen.dk</email>
  </author>
  <url>http://github.com/jacobat/stackit/commit/fd8ed3a39333fea5e50dac82b27ca19918160712</url>
  <id>fd8ed3a39333fea5e50dac82b27ca19918160712</id>
  <committed-date>2009-10-14T14:26:38-07:00</committed-date>
  <authored-date>2009-10-14T14:26:38-07:00</authored-date>
  <message>New spec style</message>
  <tree>c0a52f92eedbf3ba1cf76d737537565528a6d868</tree>
  <committer>
    <name>Jacob Atzen</name>
    <email>jacob@jacobatzen.dk</email>
  </committer>
</commit>
