From b4b4f289dda55e25cd938d4e03db9c39ac3dc5b3 Mon Sep 17 00:00:00 2001 From: Mike Dirolf Date: Wed, 18 Feb 2009 17:43:22 -0500 Subject: [PATCH] gridfs tests --- tests/mongo-qa/gridfs_in | 16 ++++++++++++++++ tests/mongo-qa/gridfs_out | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/mongo-qa/gridfs_in create mode 100644 tests/mongo-qa/gridfs_out diff --git a/tests/mongo-qa/gridfs_in b/tests/mongo-qa/gridfs_in new file mode 100644 index 0000000..bb39fd3 --- /dev/null +++ b/tests/mongo-qa/gridfs_in @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby + +require File.join(File.dirname(__FILE__), '_common.rb') + +require 'mongo/gridfs' +include XGen::Mongo::GridFS + +db = Mongo.new(DEFAULT_HOST, DEFAULT_PORT).db(DEFAULT_DB) + +input_file = ARGV[0] + +File.open(input_file, "r") { |f| + GridStore.open(db, input_file, "w") { |g| + g.write(f.read) + } +} diff --git a/tests/mongo-qa/gridfs_out b/tests/mongo-qa/gridfs_out new file mode 100644 index 0000000..7313b74 --- /dev/null +++ b/tests/mongo-qa/gridfs_out @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +require File.join(File.dirname(__FILE__), '_common.rb') + +require 'mongo/gridfs' +include XGen::Mongo::GridFS + +db = Mongo.new(DEFAULT_HOST, DEFAULT_PORT).db(DEFAULT_DB) + +input_file = ARGV[0] +output_file = ARGV[1] + +File.open(output_file, "w") { |f| + GridStore.open(db, input_file, "r") { |g| + f.write(g.read) + } +}