Skip to content

Commit

Permalink
Refactor: Move identifiable_collection_view example into support/
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdefreyne committed Oct 8, 2017
1 parent c0a2606 commit 61bf442
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
4 changes: 3 additions & 1 deletion spec/nanoc/base/views/item_collection_with_reps_view_spec.rb
@@ -1,9 +1,11 @@
# frozen_string_literal: true

require_relative 'support/identifiable_collection_view_examples'

describe Nanoc::ItemCollectionWithRepsView do
let(:view_class) { Nanoc::ItemWithRepsView }
let(:collection_class) { Nanoc::Int::ItemCollection }
it_behaves_like 'an identifiable collection'
it_behaves_like 'an identifiable collection view'

describe '#inspect' do
let(:wrapped) do
Expand Down
@@ -1,9 +1,11 @@
# frozen_string_literal: true

require_relative 'support/identifiable_collection_view_examples'

describe Nanoc::ItemCollectionWithoutRepsView do
let(:view_class) { Nanoc::ItemWithoutRepsView }
let(:collection_class) { Nanoc::Int::ItemCollection }
it_behaves_like 'an identifiable collection'
it_behaves_like 'an identifiable collection view'

describe '#inspect' do
let(:wrapped) do
Expand Down
4 changes: 3 additions & 1 deletion spec/nanoc/base/views/layout_collection_view_spec.rb
@@ -1,9 +1,11 @@
# frozen_string_literal: true

require_relative 'support/identifiable_collection_view_examples'

describe Nanoc::LayoutCollectionView do
let(:view_class) { Nanoc::LayoutView }
let(:collection_class) { Nanoc::Int::LayoutCollection }
it_behaves_like 'an identifiable collection'
it_behaves_like 'an identifiable collection view'

describe '#inspect' do
let(:wrapped) do
Expand Down
4 changes: 3 additions & 1 deletion spec/nanoc/base/views/mutable_item_collection_view_spec.rb
@@ -1,9 +1,11 @@
# frozen_string_literal: true

require_relative 'support/identifiable_collection_view_examples'

describe Nanoc::MutableItemCollectionView do
let(:view_class) { Nanoc::MutableItemView }
let(:collection_class) { Nanoc::Int::ItemCollection }
it_behaves_like 'an identifiable collection'
it_behaves_like 'an identifiable collection view'
it_behaves_like 'a mutable identifiable collection'

let(:config) do
Expand Down
4 changes: 3 additions & 1 deletion spec/nanoc/base/views/mutable_layout_collection_view_spec.rb
@@ -1,9 +1,11 @@
# frozen_string_literal: true

require_relative 'support/identifiable_collection_view_examples'

describe Nanoc::MutableLayoutCollectionView do
let(:view_class) { Nanoc::MutableLayoutView }
let(:collection_class) { Nanoc::Int::LayoutCollection }
it_behaves_like 'an identifiable collection'
it_behaves_like 'an identifiable collection view'
it_behaves_like 'a mutable identifiable collection'

let(:config) do
Expand Down
@@ -1,7 +1,7 @@
# frozen_string_literal: true

# Needs :view_class
shared_examples 'an identifiable collection' do
shared_examples 'an identifiable collection view' do
let(:view) { described_class.new(wrapped, view_context) }

let(:view_context) do
Expand Down

0 comments on commit 61bf442

Please sign in to comment.