Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposed shared example for file formats. #6

Merged
merged 2 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog][changelog], and this project adheres
to [Semantic Versioning][versioning].

## [Unreleased]

### Added

- Exposed the shared example for file formats. Include it in your specs with:

```ruby
require 'configsl/file_format/shared_spec'

RSpec.describe MyFileFormat do
it_behaves_like 'a file format', 'spec-config.json', %i[json], {
format: 'JSON',
name: 'config.json',
nested: { title: 'JSON file for testing' }
}
end
```

## [1.0.1]

### Fixed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

RSpec.shared_examples 'a file format' do |filename, extensions, expected|
shared_examples 'a file format' do |filename, extensions, expected|
subject(:file) { described_class.new(path) }

let(:path) { "spec/support/fixtures/#{filename}" }
Expand Down
2 changes: 1 addition & 1 deletion spec/support/examples.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# frozen_string_literal: true

require_relative 'examples/file_format_example'
require 'configsl/file_format/shared_spec'