Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch '2.0.0' into test-suite-refactor

Conflicts:
	spec/spec_helper.rb
  • Loading branch information...
commit 7cac3e61fb34c894aae9fe50b6b37d4bfc612410 2 parents 0787ba4 + 95c1c8a
@arsduo authored
View
1  Gemfile
@@ -10,7 +10,6 @@ group :development, :test do
# Testing infrastructure
gem 'guard'
gem 'guard-rspec'
- gem "parallel_tests"
if RUBY_PLATFORM =~ /darwin/
# OS X integration
View
7 changelog.md
@@ -1,3 +1,10 @@
+v1.7
+====
+
+Internal improvements:
+* CHANGED: Gem version restrictions have been removed, and versions updated.
+* CHANGED: How support files are loaded in spec_helper has been improved.
+
v1.6
====
View
10 koala.gemspec
@@ -20,9 +20,9 @@ Gem::Specification.new do |gem|
gem.extra_rdoc_files = ["readme.md", "changelog.md"]
gem.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Koala"]
- gem.add_runtime_dependency(%q<multi_json>, ["~> 1.3"])
- gem.add_runtime_dependency(%q<faraday>, ["~> 0.8"])
- gem.add_runtime_dependency(%q<addressable>, ["~> 2.2"])
- gem.add_development_dependency(%q<rspec>, ["~> 2.8"])
- gem.add_development_dependency(%q<rake>, ["~> 0.8"])
+ gem.add_runtime_dependency("multi_json")
+ gem.add_runtime_dependency("faraday")
+ gem.add_runtime_dependency("addressable")
+ gem.add_development_dependency("rspec")
+ gem.add_development_dependency("rake")
end
View
2  lib/koala/version.rb
@@ -1,3 +1,3 @@
module Koala
- VERSION = "1.6.0"
+ VERSION = "1.7.0"
end
View
20 spec/spec_helper.rb
@@ -1,9 +1,3 @@
-begin
- require 'bundler/setup'
-rescue LoadError
- puts 'Although not required, bundler is recommended for running the tests.'
-end
-
# In Ruby 1.9.2 versions before patchlevel 290, the default Psych
# parser has an issue with YAML merge keys, which
# fixtures/mock_facebook_responses.yml relies heavily on.
@@ -21,24 +15,18 @@
# See https://github.com/tenderlove/psych/issues/8 for more details
YAML::ENGINE.yamler = 'syck' if RUBY_VERSION == '1.9.2' && RUBY_PATCHLEVEL < 290
-# load custom RSpec matchers
-require 'support/custom_matchers'
-
# load the library
require 'koala'
-# ensure consistent to_json behavior
-# this must be required first so mock_http_service loads the YAML as expected
+# Support files
+# we have to first ensure consistent to_json behavior across versions
+# otherwise mock_http_service may parse the YAML improperly
require 'support/ordered_hash'
require 'support/json_testing_fix'
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
# set up our testing environment
-require 'support/mock_http_service'
-require 'support/koala_test'
# load testing data and (if needed) create test users or validate real users
KoalaTest.setup_test_environment!
-# load supporting files for our tests
-require 'support/rest_api_shared_examples'
-
BEACH_BALL_PATH = File.join(File.dirname(__FILE__), "fixtures", "beach.jpg")
View
12 spec/support/json_testing_fix.rb
@@ -1,3 +1,5 @@
+require 'multi_json'
+
# when testing across Ruby versions, we found that JSON string creation inconsistently ordered keys
# which is a problem because our mock testing service ultimately matches strings to see if requests are mocked
# this fix solves that problem by ensuring all hashes are created with a consistent key order every time
@@ -14,16 +16,16 @@ def dump_with_ordering(object)
alias_method :dump_original, :dump
alias_method :dump, :dump_with_ordering
-
+
def load_with_ordering(string)
sort_object(load_original(string))
end
alias_method :load_original, :load
alias_method :load, :load_with_ordering
-
- private
-
+
+ private
+
def sort_object(object)
if object.is_a?(Hash)
sort_hash(object)
@@ -33,7 +35,7 @@ def sort_object(object)
object
end
end
-
+
def sort_hash(unsorted_hash)
sorted_hash = KoalaTest::OrderedHash.new(sorted_hash)
unsorted_hash.keys.sort {|a, b| a.to_s <=> b.to_s}.inject(sorted_hash) {|hash, k| hash[k] = unsorted_hash[k]; hash}
Please sign in to comment.
Something went wrong with that request. Please try again.