Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor palindromic shared context to work with rspec2.3
Make a temporary, more focused 'palindromic2' tag (@todo temporary) (26 examples, 0 failures) (Run filtered using {:palindromic2=>true}) @smell is it clear enough what is going on? can it be cleaned up?
- Loading branch information
Showing
2 changed files
with
31 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,23 +1,39 @@ | |||
shared_examples_for "the palindromic fixture" do | module PalindromicFixtureSharedContext | ||
attr_reader :list, :node | extend RSpec::Core::SharedContext | ||
include IntervalSkipListSpecHelper | include IntervalSkipListSpecHelper | ||
|
|
||
before do | attr_reader :list, :node | ||
|
|||
def construct_interval_skip_list | |||
@list = IntervalSkipList.new | @list = IntervalSkipList.new | ||
end | end | ||
|
|
||
it_should_behave_like "#next_node_height is deterministic" | |||
def expected_node_heights | def expected_node_heights | ||
[3, 2, 1, 3, 1, 2, 3] | [3, 2, 1, 3, 1, 2, 3] | ||
end | end | ||
|
|
||
before do | def populate_interval_skip_list | ||
list.insert(1..3, :a) | @list.insert(1..3, :a) | ||
list.insert(1..5, :b) | @list.insert(1..5, :b) | ||
list.insert(1..7, :c) | @list.insert(1..7, :c) | ||
list.insert(1..9, :d) | @list.insert(1..9, :d) | ||
list.insert(1..11, :e) | @list.insert(1..11, :e) | ||
list.insert(1..13, :f) | @list.insert(1..13, :f) | ||
list.insert(5..13, :g) | @list.insert(5..13, :g) | ||
end | |||
|
|||
def make_it_determinisitic | |||
extend NextNodeHeightIsDeterministicSharedContext # use the method without getting the filter | |||
next_node_height_is_deterministic | |||
end | |||
|
|||
before :each do | |||
construct_interval_skip_list | |||
make_it_determinisitic | |||
populate_interval_skip_list | |||
end | end | ||
end | end | ||
|
|||
shared_examples_for "the palindromic fixture" do | |||
# @todo needs cleanup! | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters