Skip to content

Commit

Permalink
Renamed generate_xmlpipe2 to xmlpipe2
Browse files Browse the repository at this point in the history
  • Loading branch information
eddloschi committed Mar 14, 2014
1 parent 5083872 commit 71e83b4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/mongoid/giza/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def criteria(new_criteria = nil)
# Generates a XML document according to the XMLPipe2 specification from Sphinx
#
# @param buffer [#<<] any IO object that supports appending content using <<
def generate_xmlpipe2(buffer)
def xmlpipe2(buffer)
Mongoid::Giza::XMLPipe2.new(self, buffer).generate!
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/giza/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Railtie < Rails::Railtie

initializer "mongoid-giza.load-configuration" do
# Sets the default xmlpipe_command
configuration.source.xmlpipe_command = "rails r '<%= index.klass %>.sphinx_indexes[:<%= index.name %>].generate_xmlpipe2(STDOUT)'"
configuration.source.xmlpipe_command = "rails r '<%= index.klass %>.sphinx_indexes[:<%= index.name %>].xmlpipe2(STDOUT)'"
# Loads the configuration file
file = Rails.root.join("config", "giza.yml")
configuration.load(file, Rails.env) if file.file?
Expand Down
6 changes: 3 additions & 3 deletions spec/mongoid/giza/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,20 @@
end
end

describe "generate_xmlpipe2" do
describe "xmlpipe2" do
let(:xmlpipe2) { double("XMLPipe2") }

let(:buffer) { double("buffer") }

it "should create a new XMLPipe2 object" do
expect(Mongoid::Giza::XMLPipe2).to receive(:new).with(index, buffer) { xmlpipe2.as_null_object }
index.generate_xmlpipe2(buffer)
index.xmlpipe2(buffer)
end

it "should generate the xml" do
allow(Mongoid::Giza::XMLPipe2).to receive(:new) { xmlpipe2 }
expect(xmlpipe2).to receive(:generate!)
index.generate_xmlpipe2(buffer)
index.xmlpipe2(buffer)
end
end

Expand Down

0 comments on commit 71e83b4

Please sign in to comment.