Sha256: 30f93b8f4c0f8f072c469a89b806235bd800b7db17e4dd31feb37d9a2eaaf32f

Contents?: true

Size: 837 Bytes

Versions: 6

Compression:

Stored size: 837 Bytes

Contents

require "spec_helper"

describe Object do

  describe "blank?" do
    it "returns true for Objects perceived to be blank" do
      ["", false, nil, [], {}].each do |object|
        object.should be_blank
      end
    end

    it "returns false for every other Object" do
      ["!blank", true, [:a], {:a => "b"}].each do |object|
        object.should_not be_blank
      end
    end
  end

  describe "to_soap_value" do
    it "returns an xs:dateTime compliant String for Objects responding to to_datetime" do
      singleton = Object.new
      def singleton.to_datetime
        DateTime.new(2012, 03, 22, 16, 22, 33)
      end

      singleton.to_soap_value.should == "2012-03-22T16:22:33Z"
    end

    it "calls to_s unless the Object responds to to_datetime" do
      "value".to_soap_value.should == "value".to_s
    end
  end

end

Version data entries

6 entries across 6 versions & 4 rubygems

Version Path
tictoc-savon-0.7.9 spec/savon/core_ext/object_spec.rb
pyu-savon-0.7.9.3 spec/savon/core_ext/object_spec.rb
hoopla-savon-0.7.9 spec/savon/core_ext/object_spec.rb
savon-0.7.9 spec/savon/core_ext/object_spec.rb
savon-0.7.8 spec/savon/core_ext/object_spec.rb
savon-0.7.7 spec/savon/core_ext/object_spec.rb