Sha256: a1f17db07db061bc052a8f6c2e8c4efa055e16eddecff14353e2f08c978e0a13
Contents?: true
Size: 1.4 KB
Versions: 4
Compression:
Stored size: 1.4 KB
Contents
require 'test_helper' class Elasticsearch::Model::ModuleTest < Test::Unit::TestCase context "The main module" do context "client" do should "have a default" do client = Elasticsearch::Model.client assert_not_nil client assert_instance_of Elasticsearch::Transport::Client, client end should "be settable" do begin Elasticsearch::Model.client = "Foobar" assert_equal "Foobar", Elasticsearch::Model.client ensure Elasticsearch::Model.client = nil end end end context "when included in module/class, " do class ::DummyIncludingModel; end should "include and set up the proxy" do DummyIncludingModel.__send__ :include, Elasticsearch::Model assert_respond_to DummyIncludingModel, :__elasticsearch__ assert_respond_to DummyIncludingModel.new, :__elasticsearch__ end should "delegate important methods to the proxy" do DummyIncludingModel.__send__ :include, Elasticsearch::Model assert_respond_to DummyIncludingModel, :search assert_respond_to DummyIncludingModel, :mappings assert_respond_to DummyIncludingModel, :settings assert_respond_to DummyIncludingModel, :index_name assert_respond_to DummyIncludingModel, :document_type assert_respond_to DummyIncludingModel, :import end end end end
Version data entries
4 entries across 4 versions & 1 rubygems