-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

at the work shop we decided to use RSpec as the testing framework
and I started to write spec-files for the YaST Fcoe Client.

The task was to create tests for a method which calls some methods
reading from system files or getting hardware info.
So for the test I need return values set for these methods. This is
done by using stubs.

Tested method is FcoeClient::DetectNetworkCards which calls e.g.
GetVlanInterfaces and GetFcoeStatus.

Examples for stubs of called methods:

@test_class.stub(:GetFcoeStatus).with("eth1.300", "eth1").and_return({})

@test_class.stub(:GetVlanInterfaces).and_return({
        "eth1" => [{ "vlan" => "400", "fcf" => "00:0d:ec:a2:ef:00" },
                   { "vlan" => "300", "fcf" => "00:0d:ec:a2:ef:01" }],
        "eth2" => [{ "vlan" => "200", "fcf" => "00:0d:ec:a2:ef:02" }]})

The complete spec-file DetectNetworkCards_spec.rb is attached.

Complete yast-fcoe-client on https://github.com/yast/yast-fcoe-client.

Greetings
Gabi

- -- 
Gabriele Mohr
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix
Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstr. 5                  Tel:    +49 911 740 53 362
90409 Nürnberg                 Email:  [email protected]
- -----------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iD8DBQFSQDfnzwhO63ql6h0RArbsAKCFMX3xIqgETzgLkEsB9nlFsrl1YACfVPDE
ijio8fhWxfklP66+mAvinFw=
=cIeA
-----END PGP SIGNATURE-----

Attachment: DetectNetworkCards_spec.rb
Description: application/ruby

Reply via email to