helper.rb 501 B

1234567891011121314151617181920212223242526272829303132
  1. def jruby?
  2. defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
  3. end
  4. def macruby?
  5. defined?(RUBY_ENGINE) && RUBY_ENGINE == 'macruby'
  6. end
  7. unless ENV['CI'] || macruby?
  8. require 'simplecov'
  9. SimpleCov.start do
  10. add_filter 'spec'
  11. end
  12. end
  13. require 'multi_json'
  14. require 'rspec'
  15. class MockDecoder
  16. def self.load(string, options={})
  17. {'abc' => 'def'}
  18. end
  19. def self.dump(string)
  20. '{"abc":"def"}'
  21. end
  22. end
  23. class TimeWithZone
  24. def to_json(options={})
  25. "\"2005-02-01T15:15:10Z\""
  26. end
  27. end