diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index e6245a1..0000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,6 +0,0 @@ -# require 'coveralls' -# Coveralls.wear! - -require 'minitest/autorun' -require 'fog/core' -require 'fog/openstack' diff --git a/tests/hadoop/requests/compute/app_stats_tests.rb b/tests/hadoop/requests/compute/app_stats_tests.rb index 48977ec..d29f2e7 100644 --- a/tests/hadoop/requests/compute/app_stats_tests.rb +++ b/tests/hadoop/requests/compute/app_stats_tests.rb @@ -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 @@ -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 } @@ -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 }