File: helper.rb

package info (click to toggle)
ruby-multi-json 1.3.6-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 180 kB
  • sloc: ruby: 845; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 501 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
def jruby?
  defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
end

def macruby?
  defined?(RUBY_ENGINE) && RUBY_ENGINE == 'macruby'
end

unless ENV['CI'] || macruby?
  require 'simplecov'
  SimpleCov.start do
    add_filter 'spec'
  end
end
require 'multi_json'
require 'rspec'

class MockDecoder
  def self.load(string, options={})
    {'abc' => 'def'}
  end

  def self.dump(string)
    '{"abc":"def"}'
  end
end

class TimeWithZone
  def to_json(options={})
    "\"2005-02-01T15:15:10Z\""
  end
end