<feed xmlns='http://www.w3.org/2005/Atom'>
<title>chouette-core/spec/lib, branch check_policy_specs</title>
<subtitle>Chouette manage transport static data</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/'/>
<entry>
<title>refs 3604 @12h all tests pass</title>
<updated>2017-06-09T15:25:06+00:00</updated>
<author>
<name>Robert</name>
</author>
<published>2017-06-09T15:04:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=63a893c22feca2c26cd8eecef2e6deb8ff97bd26'/>
<id>63a893c22feca2c26cd8eecef2e6deb8ff97bd26</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs: #3604 @2h  checking sequences as defaults</title>
<updated>2017-06-08T08:51:27+00:00</updated>
<author>
<name>Robert</name>
</author>
<published>2017-06-08T08:51:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=38e5a5329541a54f98d771c3aa252b91b823b94f'/>
<id>38e5a5329541a54f98d771c3aa252b91b823b94f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs: #3604; rewriting schema cloner in Ruby</title>
<updated>2017-06-06T13:50:54+00:00</updated>
<author>
<name>Robert</name>
</author>
<published>2017-06-06T13:50:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=15b7cf8213d730fa36740a74bc75baa5fc56dd62'/>
<id>15b7cf8213d730fa36740a74bc75baa5fc56dd62</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs: #3604; added tests for cloning with data ⇒ ✓</title>
<updated>2017-06-06T09:32:23+00:00</updated>
<author>
<name>Robert</name>
</author>
<published>2017-06-06T08:41:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=12290bbdabb8f53c4dddb1a647296a426b88709e'/>
<id>12290bbdabb8f53c4dddb1a647296a426b88709e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Revert "time_duration_spec.rb: Make old test style uniform with new tests""</title>
<updated>2017-05-31T16:15:10+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-05-31T16:15:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=04e70325040d7178a18bb126c4f7e36103c04fd9'/>
<id>04e70325040d7178a18bb126c4f7e36103c04fd9</id>
<content type='text'>
This reverts commit b0e6bc3ffd02146fd999f12975f269dac94a0994.

Reinstate the updated `TimeDuration` spec code. Seems like this was
reverted by accident. Robert was doing a complicated merge/rebase and
somehow in the mix this commit ended up being unintentionally reverted.

&gt; 16:23:26 +0200 &lt; robert&gt; @teddy merge idiosynchrasy I did not touch these specs deliberately but must have pulled in the old version by error sorry
&gt; 16:24:19 +0200 &lt; robert&gt; I had some strange conflicts and rebased twice, hmmm, strange though I just did not touch these specs for months
&gt; ...
&gt; 16:25:10 +0200 &lt; robert&gt; anywyay feelfree to undo my undoing :blush:
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit b0e6bc3ffd02146fd999f12975f269dac94a0994.

Reinstate the updated `TimeDuration` spec code. Seems like this was
reverted by accident. Robert was doing a complicated merge/rebase and
somehow in the mix this commit ended up being unintentionally reverted.

&gt; 16:23:26 +0200 &lt; robert&gt; @teddy merge idiosynchrasy I did not touch these specs deliberately but must have pulled in the old version by error sorry
&gt; 16:24:19 +0200 &lt; robert&gt; I had some strange conflicts and rebased twice, hmmm, strange though I just did not touch these specs for months
&gt; ...
&gt; 16:25:10 +0200 &lt; robert&gt; anywyay feelfree to undo my undoing :blush:
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "time_duration_spec.rb: Make old test style uniform with new tests"</title>
<updated>2017-05-29T12:32:43+00:00</updated>
<author>
<name>Robert</name>
</author>
<published>2017-05-29T12:32:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=b0e6bc3ffd02146fd999f12975f269dac94a0994'/>
<id>b0e6bc3ffd02146fd999f12975f269dac94a0994</id>
<content type='text'>
This reverts commit 52d2c968cac7e901b8e6fa3d1be115239b7c5937.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 52d2c968cac7e901b8e6fa3d1be115239b7c5937.
</pre>
</div>
</content>
</entry>
<entry>
<title>time_duration_spec.rb: Make old test style uniform with new tests</title>
<updated>2017-05-29T06:49:52+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-05-26T11:27:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=52d2c968cac7e901b8e6fa3d1be115239b7c5937'/>
<id>52d2c968cac7e901b8e6fa3d1be115239b7c5937</id>
<content type='text'>
Change the variable names to `earlier` and `later`, and use explicit
`true` and `false` values to be consistent with the newer tests in this
file. The new variable names in particular should be a little quicker to
understand.

Refs #870
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change the variable names to `earlier` and `later`, and use explicit
`true` and `false` values to be consistent with the newer tests in this
file. The new variable names in particular should be a little quicker to
understand.

Refs #870
</pre>
</div>
</content>
</entry>
<entry>
<title>TimeDuration.exceeds_gap?: Fix duration &gt; 24 hours behaviour</title>
<updated>2017-05-29T06:49:52+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-05-26T11:08:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=38b66adee9ea1c7d70e0bdb46c25068965c1f88a'/>
<id>38b66adee9ea1c7d70e0bdb46c25068965c1f88a</id>
<content type='text'>
Previously, the `#exceeds_gap?` method would modulo the
`later - earlier` duration against 24 hours such that no duration
exceeded 24 hours, and the resulting duration being compared was
adjusted to fit inside a single day.

When we removed the numbers from `exceeds_gap?`, we also removed the
modulo operation. I had a feeling that would potentially cause problems,
and it turns out it did. Though it still took too much investigation
time to realise that the most obvious answer was in fact the correct
one. Blame the confusing test failures if I will:

    Failures:

      1) Chouette::VehicleJourney state_update should return errors when validation failed
         Failure/Error: expect(state['errors'][:vehicle_journey_at_stops].size).to eq 1

         NoMethodError:
           undefined method `[]' for nil:NilClass
         # ./spec/models/chouette/vehicle_journey_spec.rb:148:in `block (3 levels) in &lt;top (required)&gt;'

      2) Chouette::VehicleJourney state_update vehicle_journey_at_stops should return errors when validation failed
         Failure/Error: expect(item['errors'][:arrival_time].size).to eq 1

         NoMethodError:
           undefined method `[]' for nil:NilClass
         # ./spec/models/chouette/vehicle_journey_spec.rb:189:in `block (4 levels) in &lt;top (required)&gt;'

      3) VehicleJourneyImport.save should not import vehicle_journeys and not create objects when vehicle journey at stops are not in ascendant order
         Failure/Error: expect(VehicleJourneyImport.new(:route =&gt; route, :file =&gt; invalid_file_on_vjas_object).save).to be_falsey

           expected: falsey value
                got: true
         # ./spec/models/vehicle_journey_import_spec.rb:90:in `block (3 levels) in &lt;top (required)&gt;'

    Finished in 4 minutes 20.7 seconds (files took 14.47 seconds to load)
    1089 examples, 3 failures, 23 pending

    Failed examples:

    rspec ./spec/models/chouette/vehicle_journey_spec.rb:137 # Chouette::VehicleJourney state_update should return errors when validation failed
    rspec ./spec/models/chouette/vehicle_journey_spec.rb:183 # Chouette::VehicleJourney state_update vehicle_journey_at_stops should return errors when validation failed
    rspec ./spec/models/vehicle_journey_import_spec.rb:89 # VehicleJourneyImport.save should not import vehicle_journeys and not create objects when vehicle journey at stops are not in ascendant order

These three tests failed with my version of `exceeds_gap?`.

To correct the failures, add back in the 24-hour adjustment. Put it in a
named method that is hopefully clear enough to understand.

The second test failure ("vehicle_journey_at_stops should return errors
when validation failed") used two times that were the same. I decided to
add a test for this because it seemed like an interesting edge case. The
test I added didn't fail even for the previous version of
`.exceeds_gap?`, but I figure it seems like a useful test anyway.

Refs #870
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the `#exceeds_gap?` method would modulo the
`later - earlier` duration against 24 hours such that no duration
exceeded 24 hours, and the resulting duration being compared was
adjusted to fit inside a single day.

When we removed the numbers from `exceeds_gap?`, we also removed the
modulo operation. I had a feeling that would potentially cause problems,
and it turns out it did. Though it still took too much investigation
time to realise that the most obvious answer was in fact the correct
one. Blame the confusing test failures if I will:

    Failures:

      1) Chouette::VehicleJourney state_update should return errors when validation failed
         Failure/Error: expect(state['errors'][:vehicle_journey_at_stops].size).to eq 1

         NoMethodError:
           undefined method `[]' for nil:NilClass
         # ./spec/models/chouette/vehicle_journey_spec.rb:148:in `block (3 levels) in &lt;top (required)&gt;'

      2) Chouette::VehicleJourney state_update vehicle_journey_at_stops should return errors when validation failed
         Failure/Error: expect(item['errors'][:arrival_time].size).to eq 1

         NoMethodError:
           undefined method `[]' for nil:NilClass
         # ./spec/models/chouette/vehicle_journey_spec.rb:189:in `block (4 levels) in &lt;top (required)&gt;'

      3) VehicleJourneyImport.save should not import vehicle_journeys and not create objects when vehicle journey at stops are not in ascendant order
         Failure/Error: expect(VehicleJourneyImport.new(:route =&gt; route, :file =&gt; invalid_file_on_vjas_object).save).to be_falsey

           expected: falsey value
                got: true
         # ./spec/models/vehicle_journey_import_spec.rb:90:in `block (3 levels) in &lt;top (required)&gt;'

    Finished in 4 minutes 20.7 seconds (files took 14.47 seconds to load)
    1089 examples, 3 failures, 23 pending

    Failed examples:

    rspec ./spec/models/chouette/vehicle_journey_spec.rb:137 # Chouette::VehicleJourney state_update should return errors when validation failed
    rspec ./spec/models/chouette/vehicle_journey_spec.rb:183 # Chouette::VehicleJourney state_update vehicle_journey_at_stops should return errors when validation failed
    rspec ./spec/models/vehicle_journey_import_spec.rb:89 # VehicleJourneyImport.save should not import vehicle_journeys and not create objects when vehicle journey at stops are not in ascendant order

These three tests failed with my version of `exceeds_gap?`.

To correct the failures, add back in the 24-hour adjustment. Put it in a
named method that is hopefully clear enough to understand.

The second test failure ("vehicle_journey_at_stops should return errors
when validation failed") used two times that were the same. I decided to
add a test for this because it seemed like an interesting edge case. The
test I added didn't fail even for the previous version of
`.exceeds_gap?`, but I figure it seems like a useful test anyway.

Refs #870
</pre>
</div>
</content>
</entry>
<entry>
<title>time_duration_spec.rb: Remove unnecessary `let!` &amp; `subject`</title>
<updated>2017-05-29T06:49:52+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-05-24T12:37:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=8783ba692a1a648fbd4e249037c790a588a98fca'/>
<id>8783ba692a1a648fbd4e249037c790a588a98fca</id>
<content type='text'>
These are holdovers from when these specs were copied from
`vehicle_journey_at_stop_spec.rb`. They're not used in our specs now so
get rid of them.

Refs #870
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These are holdovers from when these specs were copied from
`vehicle_journey_at_stop_spec.rb`. They're not used in our specs now so
get rid of them.

Refs #870
</pre>
</div>
</content>
</entry>
<entry>
<title>TimeDuration: Move `.exceeds_gap?` specs into the module's spec file</title>
<updated>2017-05-29T06:49:52+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-05-24T09:46:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=8efdf7cadf0659601bb303a4eaeb9a5d7f6a78fc'/>
<id>8efdf7cadf0659601bb303a4eaeb9a5d7f6a78fc</id>
<content type='text'>
Take the specs out of the `IncreasingTimeOrderValidator` spec and move
them into `TimeDuration`. This is part of the consolidation and complete
move of the `exceeds_gap?` method into `TimeDuration`.

Add a context to the two test blocks that specifies the duration at a 4
hour gap. Currently the implementation doesn't do anything with that
argument, but this makes it clearer that we're using a four hour
duration.

Refs #870
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Take the specs out of the `IncreasingTimeOrderValidator` spec and move
them into `TimeDuration`. This is part of the consolidation and complete
move of the `exceeds_gap?` method into `TimeDuration`.

Add a context to the two test blocks that specifies the duration at a 4
hour gap. Currently the implementation doesn't do anything with that
argument, but this makes it clearer that we're using a four hour
duration.

Refs #870
</pre>
</div>
</content>
</entry>
</feed>
