Sha256: 2842f5bfae2e37fce2e6bb8e82bf74514cbe2fb4bcb0cbe20876ba581433cd1b

Contents?: true

Size: 761 Bytes

Versions: 3

Compression:

Stored size: 761 Bytes

Contents

require 'ruby_wrapper'

describe 'wrapper' do
  before do
    examples_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'examples'))
    $: << examples_dir

    @script = 'wordcount.rb'
    @output, @repoter = mock('output'), mock('repoter') 

    @key, @value = Text.new, Text.new
    @key.set('key')
    @value.set('value')
  end

  it 'can wrap setup' do
    wrap_setup(mock('conf'), @script, nil)
  end

  it 'can wrap mapper' do
    @output.should_receive(:collect).once
    wrap_map(@key, @value, @output, @reporter, @script, nil)
  end

  it 'can wrap reducer' do
    @output.should_receive(:collect).once
    values = [1, 2, 3].map {|v| IntWritable.new(v)}.to_java
    wrap_reduce(@key, values, @output, @reporter, @script, nil)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jruby-on-hadoop-0.0.6 spec/ruby_wrapper_spec.rb
jruby-on-hadoop-0.0.5 spec/ruby_wrapper_spec.rb
jruby-on-hadoop-0.0.4 spec/ruby_wrapper_spec.rb