aboutsummaryrefslogblamecommitdiffstats
path: root/spec/nodes/update_statement_spec.rb
blob: 860d1c448aa49cd017191e1c668e3924317fd18a (plain) (tree)
1
2
3
4
5
6
7
8
9


                                        

                                    



                                                  

                                                                   

                             

                                            


       
require 'spec_helper'

describe Arel::Nodes::UpdateStatement do
  describe "#clone" do
    it "clones wheres and values" do
      statement = Arel::Nodes::UpdateStatement.new
      statement.wheres = %w[a b c]
      statement.values = %w[x y z]

      statement.wheres.should_receive(:clone).and_return([:wheres])
      statement.values.should_receive(:clone).and_return([:values])

      dolly = statement.clone
      check dolly.wheres.should == [:wheres]
      check dolly.values.should == [:values]
    end
  end
end