#-*- coding: utf-8; -*-

require 'lib/mastermind'

describe "Creating a code from a string" do

  it "should work for an all white code" do
    code = Mastermind::Code.new(:white, :white, :white, :white)
    code.mark(Mastermind::Code.from_string('wwww')).should be_win
  end

  it "should work for a mixed code" do
    code = Mastermind::Code.new(:black, :cyan, :green, :red)
    code.mark(Mastermind::Code.from_string('bcgr')).should be_win
  end

  it "should work for another mixed code" do
    code = Mastermind::Code.new(:green, :red, :yellow, :white)
    code.mark(Mastermind::Code.from_string('gryw')).should be_win
  end


end
