Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions spec/spec_helper.rb

This file was deleted.

31 changes: 30 additions & 1 deletion tests/hadoop/requests/compute/app_stats_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,30 @@
"type" => String,
"count" => Integer
}

@app_stats_mock = [
{
"state" => "accepted",
"type" => "mapreduce",
"count" => 4
},
{
"state" => "running",
"type" => "mapreduce",
"count" => 1
},
{
"state" => "finished",
"type" => "mapreduce",
"count" => 7
}
]
@app_stats_detail_mock = [
{
"state" => "accepted",
"type" => "mapreduce",
"count" => 4
}
]
tests('success') do
tests('#get_app_stats') do
stats = hadoop_compute_service.get_app_stats
Expand All @@ -19,6 +42,9 @@
tests('Info').formats(@app_stats_format, false) do
stats.body.last
end
tests('Mock is OK') do
returns(@app_stats_mock) {stats.body}
end
else
returns(200) { stats.status }
returns(true) { stats.body.is_a? Hash }
Expand All @@ -34,6 +60,9 @@
tests('Info').formats(@app_stats_format, false) do
stats_detail.body.first
end
tests('Mock is OK') do
returns(@app_stats_detail_mock) {stats_detail.body}
end
else
returns(200) { stats_detail.status }
returns(true) { stats_detail.body.is_a? Hash }
Expand Down