Skip to content

Commit

Permalink
Merge pull request #366 from fc-arny/master
Browse files Browse the repository at this point in the history
Change extension for Markdown from .markdown to .md
  • Loading branch information
oestrich authored Apr 14, 2018
2 parents ca106a0 + 1951e3e commit f2945e4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
doc
tmp
.rvmrc
.ruby-version
Expand Down
28 changes: 14 additions & 14 deletions features/markdown_documentation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Feature: Generate Markdown documentation from test examples
And the exit status should be 0

Scenario: Index file should look like we expect
Then the file "doc/api/index.markdown" should contain exactly:
Then the file "doc/api/index.md" should contain exactly:
"""
# Example API
Example API Description
Expand All @@ -155,19 +155,19 @@ Feature: Generate Markdown documentation from test examples
Getting help
* [Getting welcome message](help/getting_welcome_message.markdown)
* [Getting welcome message](help/getting_welcome_message.md)
## Orders
* [Creating an order](orders/creating_an_order.markdown)
* [Deleting an order](orders/deleting_an_order.markdown)
* [Getting a list of orders](orders/getting_a_list_of_orders.markdown)
* [Getting a specific order](orders/getting_a_specific_order.markdown)
* [Updating an order](orders/updating_an_order.markdown)
* [Creating an order](orders/creating_an_order.md)
* [Deleting an order](orders/deleting_an_order.md)
* [Getting a list of orders](orders/getting_a_list_of_orders.md)
* [Getting a specific order](orders/getting_a_specific_order.md)
* [Updating an order](orders/updating_an_order.md)
"""

Scenario: Example 'Getting a list of orders' file should look like we expect
Then the file "doc/api/orders/getting_a_list_of_orders.markdown" should contain exactly:
Then the file "doc/api/orders/getting_a_list_of_orders.md" should contain exactly:
"""
# Orders API
Expand Down Expand Up @@ -222,7 +222,7 @@ Feature: Generate Markdown documentation from test examples
"""

Scenario: Example 'Creating an order' file should look like we expect
Then the file "doc/api/orders/creating_an_order.markdown" should contain exactly:
Then the file "doc/api/orders/creating_an_order.md" should contain exactly:
"""
# Orders API
Expand Down Expand Up @@ -266,16 +266,16 @@ Feature: Generate Markdown documentation from test examples
"""

Scenario: Example 'Deleting an order' file should be created
Then a file named "doc/api/orders/deleting_an_order.markdown" should exist
Then a file named "doc/api/orders/deleting_an_order.md" should exist

Scenario: Example 'Getting a list of orders' file should be created
Then a file named "doc/api/orders/getting_a_list_of_orders.markdown" should exist
Then a file named "doc/api/orders/getting_a_list_of_orders.md" should exist

Scenario: Example 'Getting a specific order' file should be created
Then a file named "doc/api/orders/getting_a_specific_order.markdown" should exist
Then a file named "doc/api/orders/getting_a_specific_order.md" should exist

Scenario: Example 'Updating an order' file should be created
Then a file named "doc/api/orders/updating_an_order.markdown" should exist
Then a file named "doc/api/orders/updating_an_order.md" should exist

Scenario: Example 'Getting welcome message' file should be created
Then a file named "doc/api/help/getting_welcome_message.markdown" should exist
Then a file named "doc/api/help/getting_welcome_message.md" should exist
2 changes: 1 addition & 1 deletion lib/rspec_api_documentation/views/markdown_example.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module RspecApiDocumentation
module Views
class MarkdownExample < MarkupExample
EXTENSION = 'markdown'
EXTENSION = 'md'

def initialize(example, configuration)
super
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec_api_documentation/writers/markdown_writer.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module RspecApiDocumentation
module Writers
class MarkdownWriter < GeneralMarkupWriter
EXTENSION = 'markdown'
EXTENSION = 'md'

def markup_index_class
RspecApiDocumentation::Views::MarkdownIndex
Expand Down
2 changes: 1 addition & 1 deletion spec/writers/markdown_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
FileUtils.mkdir_p(configuration.docs_dir)

writer.write
index_file = File.join(configuration.docs_dir, "index.markdown")
index_file = File.join(configuration.docs_dir, "index.md")
expect(File.exists?(index_file)).to be_truthy
end
end
Expand Down

0 comments on commit f2945e4

Please sign in to comment.