Sha256: 33981cffb4f88fbf72e0e9c9686d23b05b1b80992250151131270239cac96263

Contents?: true

Size: 725 Bytes

Versions: 8

Compression:

Stored size: 725 Bytes

Contents

require 'json'

module Calabash
  module Cucumber
    module Map #=> Connection

      def map(query, method_name, *method_args)
        raw_map(query,method_name, *method_args)['results']
      end

      def raw_map(query, method_name, *method_args)
        operation_map = {
            :method_name => method_name,
            :arguments => method_args
        }
        res = http({:method => :post, :path => 'map'},
                   {:query => query, :operation => operation_map})
        res = JSON.parse(res)
        if res['outcome'] != 'SUCCESS'
          screenshot_and_raise "map #{query}, #{method_name} failed because: #{res['reason']}\n#{res['details']}"
        end

        res
      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
calabash-cucumber-0.9.165 lib/calabash-cucumber/map.rb
calabash-cucumber-0.9.164 lib/calabash-cucumber/map.rb
calabash-cucumber-0.9.163 lib/calabash-cucumber/map.rb
calabash-cucumber-0.9.163.pre11 lib/calabash-cucumber/map.rb
calabash-cucumber-0.9.163.pre10 lib/calabash-cucumber/map.rb
calabash-cucumber-0.9.163.pre9 lib/calabash-cucumber/map.rb
calabash-cucumber-0.9.163.pre8 lib/calabash-cucumber/map.rb
calabash-cucumber-0.9.163.pre7 lib/calabash-cucumber/map.rb