aboutsummaryrefslogtreecommitdiffstats
path: root/spec/rubyspec/library/cgi/htmlextension/fixtures/common.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/library/cgi/htmlextension/fixtures/common.rb')
-rw-r--r--spec/rubyspec/library/cgi/htmlextension/fixtures/common.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/rubyspec/library/cgi/htmlextension/fixtures/common.rb b/spec/rubyspec/library/cgi/htmlextension/fixtures/common.rb
new file mode 100644
index 0000000000..4f951f6389
--- /dev/null
+++ b/spec/rubyspec/library/cgi/htmlextension/fixtures/common.rb
@@ -0,0 +1,15 @@
+module CGISpecs
+ def self.cgi_new(html = "html4")
+ old_request_method = ENV['REQUEST_METHOD']
+ ENV['REQUEST_METHOD'] = "GET"
+ begin
+ CGI.new(tag_maker: html)
+ ensure
+ ENV['REQUEST_METHOD'] = old_request_method
+ end
+ end
+
+ def self.split(string)
+ string.split("<").reject { |x| x.empty? }.map { |x| "<#{x}" }
+ end
+end