Upgraded Rails and RSpec
[monkeycharger.git] / vendor / plugins / rspec / rspec / failing_examples / team_spec.rb
blob41a44e551847c4dcd66c636ddf7a0209638892de
1 require File.dirname(__FILE__) + '/spec_helper'
4 class Team
5   attr_reader :players
6   def initialize
7     @players = Players.new
8   end
9 end
11 class Players
12   def initialize
13     @players = []
14   end
15   def size
16     @players.size
17   end
18   def include? player
19     raise "player must be a string" unless player.is_a?(String)
20     @players.include? player
21   end
22 end
24 describe "A new team" do
25   
26   before(:each) do
27     @team = Team.new
28   end
29   
30   it "should have 3 players (failing example)" do
31     @team.should have(3).players
32   end
33   
34   it "should include some player (failing example)" do
35     @team.players.should include("Some Player")
36   end
38   it "should include 5 (failing example)" do
39     @team.players.should include(5)
40   end
41   
42   it "should have no players"
43   
44 end