Skip to content

Commit

Permalink
Exposed shared example for file formats. (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesiarmes authored Sep 15, 2024
1 parent 1f66935 commit 6a2557e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
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'

0 comments on commit 6a2557e

Please # to comment.