dm-parse 0.3.13 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/dm-parse.gemspec +1 -1
- data/lib/property/parse_date.rb +2 -0
- data/spec/parse_adapter_spec.rb +10 -2
- data/spec/parse_date_spec.rb +6 -0
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0.3. | 
| 1 | 
            +
            0.3.14
         | 
    
        data/dm-parse.gemspec
    CHANGED
    
    
    
        data/lib/property/parse_date.rb
    CHANGED
    
    
    
        data/spec/parse_adapter_spec.rb
    CHANGED
    
    | @@ -31,8 +31,16 @@ describe DataMapper::Adapters::ParseAdapter do | |
| 31 31 |  | 
| 32 32 | 
             
                [:gt, :gte, :lt, :lte].each do |slug|
         | 
| 33 33 | 
             
                  context "when query has #{slug} comparison" do
         | 
| 34 | 
            -
                    let(: | 
| 35 | 
            -
                     | 
| 34 | 
            +
                    let(:closed_at) { DateTime.parse("2011-08-21T18:02:52.249Z") }
         | 
| 35 | 
            +
                    let(:query) { model.all(:id => "z", :closed_at.send(slug) => closed_at).query }
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                    it { should eq("objectId" => "z", "closedAt" => {"$#{slug}" => {"__type" => "Date", "iso" => closed_at.utc.iso8601(3)}}) }
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                    context "when closed_at is a Date" do
         | 
| 40 | 
            +
                      let(:closed_at) { Date.parse "2011-08-21" }
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                      it { should eq("objectId" => "z", "closedAt" => {"$#{slug}" => {"__type" => "Date", "iso" => closed_at.to_datetime.utc.iso8601(3)}}) }
         | 
| 43 | 
            +
                    end
         | 
| 36 44 | 
             
                  end
         | 
| 37 45 | 
             
                end
         | 
| 38 46 |  | 
    
        data/spec/parse_date_spec.rb
    CHANGED
    
    | @@ -16,6 +16,12 @@ describe DataMapper::Property::ParseDate do | |
| 16 16 |  | 
| 17 17 | 
             
                  it { should be_nil }
         | 
| 18 18 | 
             
                end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                context "when value is Date" do
         | 
| 21 | 
            +
                  let(:value) { Date.parse "2011-08-21" }
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                  it { should eq("__type" => "Date", "iso" => value.to_datetime.utc.iso8601(3)) }
         | 
| 24 | 
            +
                end
         | 
| 19 25 | 
             
              end
         | 
| 20 26 |  | 
| 21 27 | 
             
              describe "#load" do
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: dm-parse
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.3. | 
| 4 | 
            +
              version: 0.3.14
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -258,7 +258,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 258 258 | 
             
                  version: '0'
         | 
| 259 259 | 
             
                  segments:
         | 
| 260 260 | 
             
                  - 0
         | 
| 261 | 
            -
                  hash:  | 
| 261 | 
            +
                  hash: 1932617468942195095
         | 
| 262 262 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 263 263 | 
             
              none: false
         | 
| 264 264 | 
             
              requirements:
         |