Sha256: f03ac4586b6c036f4ac3e0cece94ba4ff13f403e5d635d55e333e6148ea67f7a

Contents?: true

Size: 1.05 KB

Versions: 9

Compression:

Stored size: 1.05 KB

Contents

# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'test/unit'
require 'solr'

# TODO: Maybe replace this with flexmock
class SolrMockBaseTestCase < Test::Unit::TestCase
  include Solr
  
  def setup
    Connection.send(:alias_method, :orig_post, :post)
  end
  
  def teardown
    Connection.send(:alias_method, :post, :orig_post)
  end
    
  def set_post_return(value)
    Connection.class_eval %{
      def post(request)
        %q{#{value}}
      end
    }
  end
  
  def test_dummy
    # So Test::Unit is happy running this class
  end
    
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
greglu-solr-ruby-0.0.7 test/unit/solr_mock_base.rb
solr-ruby-0.0.8 test/unit/solr_mock_base.rb
solr-ruby-0.0.2 test/unit/solr_mock_base.rb
solr-ruby-0.0.1 test/unit/solr_mock_base.rb
solr-ruby-0.0.5 test/unit/solr_mock_base.rb
solr-ruby-0.0.3 test/unit/solr_mock_base.rb
solr-ruby-0.0.7 test/unit/solr_mock_base.rb
solr-ruby-0.0.4 test/unit/solr_mock_base.rb
solr-ruby-0.0.6 test/unit/solr_mock_base.rb