2
2
3
3
describe "Pet" do
4
4
before do
5
- Swagger . configure do |config |
6
- config . api_key = 'special-key'
7
- config . host = 'petstore.swagger.io'
8
- config . base_path = '/v2'
9
- end
5
+ Swagger . configure do |config |
6
+ config . api_key = 'special-key'
7
+ config . host = 'petstore.swagger.io'
8
+ config . base_path = '/v2'
9
+ end
10
10
end
11
11
12
12
describe "pet methods" do
26
26
pets . length . should == 0
27
27
end
28
28
29
- it "should find a pet by status" do
30
- pets = PetApi . findPetsByStatus ( "available,sold" )
31
- pets . map { |pet |
32
- if ( pet . status != 'available' && pet . status != 'sold' )
33
- raise "pet status wasn't right"
34
- end
35
- }
36
- end
37
-
38
- it "should update a pet" do
39
- pet = Pet . new ( { 'id' => 99 , 'name' => 'programmer' , 'status' => 'coding' } )
40
- PetApi . addPet ( pet )
41
-
42
- fetched = PetApi . getPetById ( 99 )
43
- fetched . id . should == 99
44
- end
29
+ it "should find a pet by status" do
30
+ pets = PetApi . findPetsByStatus ( "available,sold" )
31
+ pets . map { |pet |
32
+ if ( pet . status != 'available' && pet . status != 'sold' )
33
+ raise "pet status wasn't right"
34
+ end
35
+ }
36
+ end
37
+
38
+ it "should update a pet" do
39
+ pet = Pet . new ( { 'id' => 99 , 'name' => 'programmer' , 'status' => 'coding' } )
40
+ PetApi . addPet ( pet )
41
+
42
+ fetched = PetApi . getPetById ( 99 )
43
+ fetched . id . should == 99
44
+ end
45
45
46
46
it "should create a pet" do
47
47
pet = Pet . new ( 'id' => 100 , 'name' => "Gorilla" )
56
56
57
57
describe "Store" do
58
58
before do
59
- Swagger . configure do |config |
60
- config . api_key = 'special-key'
61
- config . host = 'petstore.swagger.io'
62
- config . base_path = '/v2'
63
- end
59
+ Swagger . configure do |config |
60
+ config . api_key = 'special-key'
61
+ config . host = 'petstore.swagger.io'
62
+ config . base_path = '/v2'
63
+ end
64
64
end
65
65
66
66
it "should fetch an order" do
67
67
item = StoreApi . getOrderById ( 2 )
68
68
item . id . should == 2
69
69
end
70
- end
70
+ end
0 commit comments