Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed so that the 'Public Static Methods' is displayed in the result …
…before the method specifications, refactoring alot
- Loading branch information
1 parent
31ed115
commit ff7e148
Showing
8 changed files
with
76 additions
and
66 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module RSpec::ApiGen | ||
class Argument | ||
attr_reader :name, :description | ||
|
||
def initialize(name, description) | ||
@name = name | ||
@description = description | ||
end | ||
|
||
def to_s | ||
"Arg #{name}" | ||
end | ||
end | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module RSpec::ApiGen | ||
class Fixture | ||
attr_reader :description | ||
attr_reader :create_proc | ||
attr_reader :destroy_proc | ||
|
||
def initialize(description, create_proc, destroy_proc = nil) | ||
@description = description | ||
@create_proc = create_proc | ||
@destroy_proc = destroy_proc | ||
end | ||
|
||
def create | ||
@create_proc.call | ||
end | ||
end | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module RSpec::ApiGen | ||
module MetaHelper | ||
def self.singleton_of(obj) | ||
class << obj; | ||
self; | ||
end | ||
end | ||
|
||
def self.create_instance_method(obj, name, &block) | ||
singleton_of(obj).send(:define_method, name, &block) | ||
end | ||
|
||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module RSpec::ApiGen | ||
|
||
class StaticMethods | ||
def arg(name, description='') | ||
Argument.new(name, description) | ||
end | ||
end | ||
|
||
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
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 | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
|
||
describe Account do | ||
|
||
# jokka palm | ||
|
||
static_methods do | ||
new do | ||
|