Sha256: e60eed2fa622f92f6b2ad897cfe14e0cfbc304097f8b0e327b6edc889ad9a3cf

Contents?: true

Size: 1.02 KB

Versions: 77

Compression:

Stored size: 1.02 KB

Contents

require 'test_helper'

module Elasticsearch
  module Test
    class SnapshotCreateTest < ::Test::Unit::TestCase

      context "Snapshot: Create" do
        subject { FakeClient.new }

        should "require the :repository argument" do
          assert_raise ArgumentError do
            subject.snapshot.create :snapshot => 'bar', :body => {}
          end
        end

        should "require the :snapshot argument" do
          assert_raise ArgumentError do
            subject.snapshot.create :repository => 'foo', :body => {}
          end
        end

        should "perform correct request" do
          subject.expects(:perform_request).with do |method, url, params, body|
            assert_equal 'PUT', method
            assert_equal '_snapshot/foo/bar', url
            assert_equal Hash.new, params
            assert_equal Hash.new, body
            true
          end.returns(FakeResponse.new)

          subject.snapshot.create :repository => 'foo', :snapshot => 'bar', :body => {}
        end

      end

    end
  end
end

Version data entries

77 entries across 77 versions & 6 rubygems

Version Path
elasticsearch-api-1.0.16.pre test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.15 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.14 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.13 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.12 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.11 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.10 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.9 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.7 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.6 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.5 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.4 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.2 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.1 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.0 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.0.rc2 test/unit/snapshot/create_test.rb
elasticsearch-api-1.0.0.rc1 test/unit/snapshot/create_test.rb