spec/accept_spec.rb in cuba-api-0.1.0 vs spec/accept_spec.rb in cuba-api-0.2.0
- old
+ new
@@ -1,8 +1,10 @@
require 'spec_helper'
+require 'cuba_api/config'
require 'cuba_api/write_aspect'
require 'cuba_api/accept_content'
+require 'yaml'
class B
def method_missing( method, *args )
method.to_s
end
@@ -23,10 +25,12 @@
end
end
end
it 'creates yaml' do
+ skip("to_yaml add extra line with ...") if defined?( JRUBY_VERSION ) and (( JRUBY_VERSION =~ /^1.6./ ) == 0 ) and ( nil == (RUBY_VERSION =~ /^1.8/) )
+
_, _, resp = Cuba.call({"SCRIPT_NAME" => "/bla.yaml"})
resp[ 0 ] = resp[ 0 ].sub(/.*!/, "---!").sub( /\n\n/, "\n")
resp.join.must.eq "---!ruby/object:B {}\n"
_, _, resp = Cuba.call({"HTTP_ACCEPT" => "application/x-yaml"})
@@ -45,9 +49,11 @@
status, _, _ = Cuba.call({"HTTP_ACCEPT" => "application/xml"})
status.must.eq 404
end
it 'gives preference to script extension' do
+ skip("to_yaml add extra line with ...") if defined?( JRUBY_VERSION ) and (( JRUBY_VERSION =~ /^1.6./ ) == 0 ) and ( nil == (RUBY_VERSION =~ /^1.8/) )
+
_, _, resp = Cuba.call({"SCRIPT_NAME" => "/bla.yaml", "HTTP_ACCEPT" => "application/xml"})
resp[ 0 ] = resp[ 0 ].sub(/.*!/, "---!").sub( /\n\n/, "\n")
resp.join.must.eq "---!ruby/object:B {}\n"
status, _, _ = Cuba.call({"SCRIPT_NAME" => "/bla.xml", "HTTP_ACCEPT" => "application/x-yaml"})