ruby - Create an rspec test to return a name -


I feel totally TDD very confusing. I have passed the first two tests successfully, but I am pretty sure how to write the last time.

This is the need to return the student's name. I've highlighted where it should go.

RSPEC:

  Describe what to do before "# Start Impossible Machine Game" (: each) do @process = [ ] @out put = double ('output'). As_null_object @game = Game.new (@output) ends it "sends a welcome message" do @ output.should_receive (: puts) .with ('Welcome to Impossible Machine!') @ Game.Start ends " An initial message sends the game @ do @ output.should_receive (puts) .with ('Starting game ...') @ A method has been created by which the name of the students "myname = @ game.created_by myname.should ==" student name "end and end   

current test (first two tests Process, Output Def start (output) @output = output "[# {@ Output}" " DEF "puts on startup @put.puts 'Welcome to the impossible machine!' @ Output.puts 'Starting the game ...' # The end of the code to return the student #

OK you need a game created_by field that you should add, then you need to set it when you make a game and then when you play games To start, something like:

  Class game attr_accessor: Created_Attri_Radder: Process, Output Entry_writer: Process, Output DEP initialization (Output , Made_b) @ output = output @ cutted_bin = created_bi puts "[# {@ output}]" enddef start @put.puts 'welcome machine impossible!' @ Output.puts 'is launching the game ...' @output.prands@tequired end of end to the name of the student by the quote_text    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -