Sha256: d5267fa711bf9c3930e321fd7e78c8a2828cef300200000caf9d40249b69c848

Contents?: true

Size: 799 Bytes

Versions: 14

Compression:

Stored size: 799 Bytes

Contents

module CouchPotato
  module RSpec
    module RunJS
      private
  
      def run_js(js)
        path = 'couch_potato_js_runner.js'
        File.open(path, 'w') {|f| f << js}
        `js #{path}`
      end
    end
  end
end


require 'couch_potato/rspec/matchers/map_to_matcher'
require 'couch_potato/rspec/matchers/reduce_to_matcher'
require 'couch_potato/rspec/matchers/list_as_matcher'

module RSpec
  module Matchers
    def map(document)
      CouchPotato::RSpec::MapToProxy.new(document)
    end
    
    def reduce(docs, keys)
      CouchPotato::RSpec::ReduceToProxy.new(docs, keys)
    end
    
    def rereduce(docs, keys)
      CouchPotato::RSpec::ReduceToProxy.new(docs, keys, true)
    end
    
    def list(results)
      CouchPotato::RSpec::ListAsProxy.new(results)
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
couch_potato-0.6.0 lib/couch_potato/rspec/matchers.rb
couch_potato-0.5.7 lib/couch_potato/rspec/matchers.rb
couch_potato-rails2-0.5.10 lib/couch_potato/rspec/matchers.rb
couch_potato-rails2-0.5.9 lib/couch_potato/rspec/matchers.rb
couch_potato-rails2-0.5.8 lib/couch_potato/rspec/matchers.rb
couch_potato-rails2-0.5.7 lib/couch_potato/rspec/matchers.rb
couch_potato-rails2-0.5.6 lib/couch_potato/rspec/matchers.rb
couch_potato-0.5.6 lib/couch_potato/rspec/matchers.rb
couch_potato-0.5.5 lib/couch_potato/rspec/matchers.rb
couch_potato-0.5.4 lib/couch_potato/rspec/matchers.rb
couch_potato-0.5.3 lib/couch_potato/rspec/matchers.rb
couch_potato-0.5.2 lib/couch_potato/rspec/matchers.rb
couch_potato-0.5.1 lib/couch_potato/rspec/matchers.rb
couch_potato-0.5.0 lib/couch_potato/rspec/matchers.rb