spec/riak/map_reduce/phase_spec.rb in riak-client-2.2.0.pre1 vs spec/riak/map_reduce/phase_spec.rb in riak-client-2.2.0

- old
+ new

@@ -12,13 +12,13 @@ expect(phase.function).to eq(@js_fun) expect(phase.language).to eq("javascript") end it "initializes with a type and an MF" do - phase = Riak::MapReduce::Phase.new(:type => :map, :function => ["module", "function"], :language => "erlang") + phase = Riak::MapReduce::Phase.new(:type => :map, :function => %w(module function), :language => "erlang") expect(phase.type).to eq(:map) - expect(phase.function).to eq(["module", "function"]) + expect(phase.function).to eq(%w(module function)) expect(phase.language).to eq("erlang") end it "initializes with a type and a bucket/key" do phase = Riak::MapReduce::Phase.new(:type => :map, :function => {:bucket => "funs", :key => "awesome_map"}, :language => "javascript") @@ -26,11 +26,11 @@ expect(phase.function).to eq({:bucket => "funs", :key => "awesome_map"}) expect(phase.language).to eq("javascript") end it "assumes the language is erlang when the function is an array" do - phase = Riak::MapReduce::Phase.new(:type => :map, :function => ["module", "function"]) + phase = Riak::MapReduce::Phase.new(:type => :map, :function => %w(module function)) expect(phase.language).to eq("erlang") end it "assumes the language is javascript when the function is a string and starts with function" do phase = Riak::MapReduce::Phase.new(:type => :map, :function => @js_fun) @@ -98,10 +98,10 @@ expect(@phase.to_json).to include('"bucket":"design"') expect(@phase.to_json).to include('"key":"wordcount_map"') end it "includes the module and function when invoking an Erlang function" do - @phase.function = ["riak_mapreduce", "mapreduce_fun"] + @phase.function = %w(riak_mapreduce mapreduce_fun) expect(@phase.to_json).to include('"module":"riak_mapreduce"') expect(@phase.to_json).to include('"function":"mapreduce_fun"') end end end