Sha256: 3d98af6caa685bc125495913f760cee2a2eebf4db7059cb0902e1aa68a3c8809

Contents?: true

Size: 711 Bytes

Versions: 27

Compression:

Stored size: 711 Bytes

Contents

class Team
  attr_reader :players
  def initialize
    @players = Players.new
  end
end

class Players
  def initialize
    @players = []
  end
  def size
    @players.size
  end
  def include? player
    raise "player must be a string" unless player.is_a?(String)
    @players.include? player
  end
end

describe "A new team" do
  
  before(:each) do
    @team = Team.new
  end
  
  it "should have 3 players (failing example)" do
    @team.should have(3).players
  end
  
  it "should include some player (failing example)" do
    @team.players.should include("Some Player")
  end

  it "should include 5 (failing example)" do
    @team.players.should include(5)
  end
  
  it "should have no players"
  
end

Version data entries

27 entries across 27 versions & 10 rubygems

Version Path
rspec-instructure-1.3.3 examples/failing/team_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/examples/failing/team_spec.rb
rspec-1.3.2 examples/failing/team_spec.rb
rspec-1.3.1 examples/failing/team_spec.rb
rspec-1.3.1.rc examples/failing/team_spec.rb
rspec-1.3.0 examples/failing/team_spec.rb
simple-templater-0.0.1.4 gems/gems/rspec-1.2.9/examples/failing/team_spec.rb
media-path-0.1.2 vendor/rspec/examples/failing/team_spec.rb
simple-templater-0.0.1.3 vendor/rspec/examples/failing/team_spec.rb
pupu-0.0.2.pre vendor/rspec/examples/failing/team_spec.rb
media-path-0.1.1.pre vendor/rspec/examples/failing/team_spec.rb
simple-templater-0.0.1.2 vendor/rspec/examples/failing/team_spec.rb
media-path-0.1.1 vendor/rspec/examples/failing/team_spec.rb
simple-templater-0.0.1.1 vendor/rspec/examples/failing/team_spec.rb
pupu-0.0.2 vendor/rspec/examples/failing/team_spec.rb
rango-0.0.6 vendor/rspec/examples/failing/team_spec.rb
rango-0.1.pre vendor/rspec/examples/failing/team_spec.rb
pupu-0.0.1 vendor/rspec/examples/failing/team_spec.rb
media-path-0.1 vendor/rspec/examples/failing/team_spec.rb
simple-templater-0.0.1 vendor/rspec/examples/failing/team_spec.rb