spec/lib/extensions/object_spec.rb in picky-4.0.0pre1 vs spec/lib/extensions/object_spec.rb in picky-4.0.0pre2

- old
+ new

@@ -1,15 +1,16 @@ require 'spec_helper' describe Object do - + context 'basic object' do let(:object) { described_class.new } - + describe "exclaim" do it "delegates to puts" do - object.should_receive(:puts).once.with :bla + STDOUT.should_receive(:puts).once.with :bla + STDOUT.should_receive(:flush).once.with object.exclaim :bla end end @@ -22,21 +23,21 @@ end end describe 'warn_gem_missing' do it 'should warn right' do - object.should_receive(:warn).once.with "gnorf gem missing!\nTo use gnarble gnarf, you need to:\n 1. Add the following line to Gemfile:\n gem 'gnorf'\n or\n require 'gnorf'\n for example on top of your app.rb/application.rb\n 2. Then, run:\n bundle update\n" + object.should_receive(:warn).once.with "gnorf gem missing!\nTo use gnarble gnarf, you need to:\n 1. Add the following line to Gemfile:\n gem 'gnorf'\n or\n require 'gnorf'\n for example at the top of your app.rb file.\n 2. Then, run:\n bundle update\n" object.warn_gem_missing 'gnorf', 'gnarble gnarf' end end end - + describe 'indented_to_s' do describe String do let(:string) { String.new("Hello\nTest") } - + it 'indents a default amount' do string.indented_to_s.should == " Hello\n Test" end it 'indents twice' do string.indented_to_s.indented_to_s.should == " Hello\n Test" @@ -45,16 +46,16 @@ string.indented_to_s(3).should == " Hello\n Test" end end describe Array do let(:array) { Array.new(["Hello", "Test"]) } - + it 'indents a default amount' do array.indented_to_s.should == " Hello\n Test" end it 'indents twice' do array.indented_to_s.indented_to_s.should == " Hello\n Test" end end end - + end \ No newline at end of file