Skip to content

Commit

Permalink
Update defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
sidoh committed Oct 15, 2019
1 parent 7c1e6ad commit 2b35330
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/remote/helpers/transition_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module TransitionHelpers
module Defaults
PERIOD = 225
PERIOD = 500
NUM_PERIODS = 20
DURATION = PERIOD * NUM_PERIODS
end
Expand Down
7 changes: 3 additions & 4 deletions test/remote/spec/transition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,8 @@

context 'computed parameters' do
(@transition_defaults = {
duration: {default: 4.5, test: 2},
num_periods: {default: 10, test: 5},
period: {default: 450, test: 225}
duration: {default: 10.0, test: 2},
period: {default: 500, test: 225}
}).each do |k, params|
it "it should compute other parameters given only #{k}" do
seen_values = 0
Expand Down Expand Up @@ -675,7 +674,7 @@
expected_duration = (k == :duration ? params[:test] : (TransitionHelpers::Defaults::DURATION/1000.0))
num_periods = (expected_duration/period.to_f)*1000

expect(duration).to be_within(1.5).of(expected_duration)
expect(duration).to be_within(2).of(expected_duration)
expect(gap).to be_within(10).of((255/num_periods).ceil)
end
end
Expand Down

0 comments on commit 2b35330

Please sign in to comment.