spec/spec_helper.rb in urban_dictionary-0.0.2 vs spec/spec_helper.rb in urban_dictionary-1.0.0
- old
+ new
@@ -1,9 +1,37 @@
require File.expand_path('../../lib/urban_dictionary', __FILE__)
+require 'multi_json'
+require 'shellwords'
+require 'stringio'
+require 'webmock/rspec'
+
RSpec.configure do |config|
- config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.filter_run :focus
-
config.order = 'random'
end
+
+module Test
+ def self.load_fixture(name)
+ File.read(File.expand_path("../html/#{name}", __FILE__))
+ end
+
+ class IO < StringIO
+ def content
+ rewind
+ read
+ end
+
+ def include?(str)
+ content.include?(str)
+ end
+ end
+end
+
+class String
+ # Convert an input string to ARGV-like args as a shell would
+ def to_argv
+ Shellwords.split(self)
+ end
+end
+