nedry / Global-Destruction

A stand alone chat version of the Nuclear War Card Game
http://www.cortex-media.info
Other
1 stars 0 forks source link

Create integration tests #2

Open wconrad opened 10 years ago

wconrad commented 10 years ago

To aid in refactoring, the app needs integration tests. The "cucumber" branch will attempt to add them.

First install cucumber using bundler:

wayne@mercury:~/lab/global_destruction/gem$ bundle install

Then, to run the tests:

wayne@mercury:~/lab/global_destruction/gem$ cucumber

The output should look something like this:

Feature: Connect with the server

  Just working out the basic infrastructure for testing this thing.
  We don't know what to test yet, because we don't know what it
  actually does.

  Scenario: Connect          # features/connect.feature:7
    Given I start the server # features/step_definitions/server.rb:5
    Given I connect          # features/step_definitions/client.rb:5

  Scenario: Connect agin     # features/connect.feature:11
    Given I start the server # features/step_definitions/server.rb:5
    Given I connect          # features/step_definitions/client.rb:5

2 scenarios (2 passed)
4 steps (4 passed)
0m0.060s
wayne@mercury:~/lab/global_destruction/gem$ 
nedry commented 10 years ago

I never really figured out how all this automated testing is meant to work. I just throw loads of debug code in and do human testing... (;

On 28 June 2014 13:57, Wayne Conrad notifications@github.com wrote:

To aid in refactoring, the app needs integration tests. The "cucumber" branch will attempt to add them.

First install cucumber using bundler:

wayne@mercury:~/lab/global_destruction/gem$ bundle install

Then, to run the tests:

wayne@mercury:~/lab/global_destruction/gem$ cucumber

The output should look something like this:

Feature: Connect with the server

Just working out the basic infrastructure for testing this thing. We don't know what to test yet, because we don't know what it actually does.

Scenario: Connect # features/connect.feature:7 Given I start the server # features/step_definitions/server.rb:5 Given I connect # features/step_definitions/client.rb:5

Scenario: Connect agin # features/connect.feature:11 Given I start the server # features/step_definitions/server.rb:5 Given I connect # features/step_definitions/client.rb:5

2 scenarios (2 passed) 4 steps (4 passed) 0m0.060s wayne@mercury:~/lab/global_destruction/gem$

— Reply to this email directly or view it on GitHub https://github.com/nedry/Global-Destruction/issues/2.

Yoyodyne Propulsion Systems: "The Future Begins Tomorrow" Visit us at: http://www.yoyodyne-propulsion.net


"When a true genius appears in the world, you may know him by this sign, that the dunces are all in confederacy against him." -- Jonathan Swift

wconrad commented 10 years ago

It's easy, once you've done all the very hard stuff.

Now, you bring up a very good point. Once the code is instrumented for testing, most of that debug code can come out. Would you feel lost without it?

Wayne

On 06/29/2014 03:54 PM, Dennis Nedry wrote:

I never really figured out how all this automated testing is meant to work. I just throw loads of debug code in and do human testing... (;

nedry commented 10 years ago

I don't really need the debug code. I left the stuff in for the computer players because it's kind of fun to watch the status of their "brains"...

On 30 June 2014 20:18, Wayne Conrad notifications@github.com wrote:

It's easy, once you've done all the very hard stuff.

Now, you bring up a very good point. Once the code is instrumented for testing, most of that debug code can come out. Would you feel lost without it?

Wayne

On 06/29/2014 03:54 PM, Dennis Nedry wrote:

I never really figured out how all this automated testing is meant to work. I just throw loads of debug code in and do human testing... (;

— Reply to this email directly or view it on GitHub https://github.com/nedry/Global-Destruction/issues/2#issuecomment-47574169 .

Yoyodyne Propulsion Systems: "The Future Begins Tomorrow" Visit us at: http://www.yoyodyne-propulsion.net


"When a true genius appears in the world, you may know him by this sign, that the dunces are all in confederacy against him." -- Jonathan Swift