restspec 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ROADMAP.md +3 -1
- data/bin/restspec +9 -48
- data/lib/restspec/runners/installer.rb +48 -0
- data/lib/restspec/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd6e20ff601f3ae8c3bb0390fbbcf8e86c359847
|
4
|
+
data.tar.gz: 9f9f4edab9df0f8804ab34bc1d3c281649894680
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6196c805f031003909f60e2416d742ef8999393eb7d013378835ef2220f7e821743c8f057418390e5e9d6a9c419f2c65895ae1cfa80fb3c6c53e91d70b99b67
|
7
|
+
data.tar.gz: 12c4be830e60f0d7aabd30f7cd860b622c1a19d2ce4bfe6db081f2d7c0a7eca5528e7eea1ae37469a81d0b84362649dac218cc9cdc0237c81ac557c116a92930
|
data/ROADMAP.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# For 0.1.x
|
2
2
|
- 100% Test coverage.
|
3
3
|
- Include Travis.
|
4
|
-
- Test the restspec binary.
|
5
4
|
- Find a way to support a way of authentication based on cookies with an initial login.
|
6
5
|
- Find a way to avoid example value clashes when using resource tests.
|
7
6
|
- Schemas mixins or/and schemas inheritance.
|
@@ -9,3 +8,6 @@
|
|
9
8
|
# For 0.2 (They require more thoughts)
|
10
9
|
- Research pagination strategies and integrating them with `schema_id`.
|
11
10
|
- Research some way to generate markdown from a mix of the schemas and endpoints. (Like Apiary and others)
|
11
|
+
+ Generate whatever kind of markdown.
|
12
|
+
+ Generate Apiary Apib type.
|
13
|
+
+ Add a way to add texts to some points of the documentation.
|
data/bin/restspec
CHANGED
@@ -1,54 +1,15 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
class RestspecRunner < Thor::Group
|
6
|
-
include Thor::Actions
|
7
|
-
|
8
|
-
argument :project
|
9
|
-
|
10
|
-
class_option :api_prefix, :desc => "api prefix to use", :required => true
|
11
|
-
|
12
|
-
def self.source_root
|
13
|
-
File.dirname(__FILE__)
|
14
|
-
end
|
15
|
-
|
16
|
-
def create_project_dir
|
17
|
-
empty_directory project
|
18
|
-
end
|
3
|
+
lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
|
4
|
+
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
|
19
5
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
def create_spec_folders
|
25
|
-
empty_directory "#{project}/spec"
|
26
|
-
empty_directory "#{project}/spec/api"
|
27
|
-
empty_directory "#{project}/spec/support"
|
28
|
-
end
|
29
|
-
|
30
|
-
def create_spec_helper
|
31
|
-
template 'templates/spec_helper.rb', "#{project}/spec/spec_helper.rb"
|
32
|
-
end
|
33
|
-
|
34
|
-
def create_rspec_config
|
35
|
-
template 'templates/restspec_config.rb', "#{project}/spec/api/restspec/restspec_config.rb"
|
36
|
-
end
|
37
|
-
|
38
|
-
def create_api_dsl_files
|
39
|
-
create_file "#{project}/spec/api/restspec/api_endpoints.rb"
|
40
|
-
create_file "#{project}/spec/api/restspec/api_schemas.rb"
|
41
|
-
create_file "#{project}/spec/api/restspec/api_requirements.rb"
|
42
|
-
end
|
43
|
-
|
44
|
-
def create_support_files
|
45
|
-
create_file "#{project}/spec/support/custom_matchers.rb"
|
46
|
-
copy_file "templates/custom_macros.rb", "#{project}/spec/support/custom_macros.rb"
|
47
|
-
end
|
6
|
+
require 'thor'
|
7
|
+
require 'thor/group'
|
8
|
+
require 'pathname'
|
9
|
+
require 'restspec/runners/installer'
|
48
10
|
|
49
|
-
|
50
|
-
|
51
|
-
end
|
11
|
+
class RestspecCLI < Thor
|
12
|
+
register(RestspecInstaller, 'install', 'install [your tests]', 'Type foo install for more help.')
|
52
13
|
end
|
53
14
|
|
54
|
-
|
15
|
+
RestspecCLI.start(ARGV)
|
@@ -0,0 +1,48 @@
|
|
1
|
+
class RestspecInstaller < Thor::Group
|
2
|
+
include Thor::Actions
|
3
|
+
|
4
|
+
argument :project
|
5
|
+
|
6
|
+
class_option :api_prefix, :desc => "api prefix to use", :required => true
|
7
|
+
|
8
|
+
def self.source_root
|
9
|
+
Pathname.new(File.dirname(__FILE__)).join('../../../bin')
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_project_dir
|
13
|
+
empty_directory project
|
14
|
+
end
|
15
|
+
|
16
|
+
def copy_gemfile
|
17
|
+
copy_file 'templates/Gemfile', "#{project}/Gemfile"
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_spec_folders
|
21
|
+
empty_directory "#{project}/spec"
|
22
|
+
empty_directory "#{project}/spec/api"
|
23
|
+
empty_directory "#{project}/spec/support"
|
24
|
+
end
|
25
|
+
|
26
|
+
def create_spec_helper
|
27
|
+
template 'templates/spec_helper.rb', "#{project}/spec/spec_helper.rb"
|
28
|
+
end
|
29
|
+
|
30
|
+
def create_rspec_config
|
31
|
+
template 'templates/restspec_config.rb', "#{project}/spec/api/restspec/restspec_config.rb"
|
32
|
+
end
|
33
|
+
|
34
|
+
def create_api_dsl_files
|
35
|
+
create_file "#{project}/spec/api/restspec/api_endpoints.rb"
|
36
|
+
create_file "#{project}/spec/api/restspec/api_schemas.rb"
|
37
|
+
create_file "#{project}/spec/api/restspec/api_requirements.rb"
|
38
|
+
end
|
39
|
+
|
40
|
+
def create_support_files
|
41
|
+
create_file "#{project}/spec/support/custom_matchers.rb"
|
42
|
+
copy_file "templates/custom_macros.rb", "#{project}/spec/support/custom_macros.rb"
|
43
|
+
end
|
44
|
+
|
45
|
+
def install_gems
|
46
|
+
inside(project) { run 'bundle install' }
|
47
|
+
end
|
48
|
+
end
|
data/lib/restspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- juliogarciag
|
@@ -400,6 +400,7 @@ files:
|
|
400
400
|
- lib/restspec/rspec/matchers/have_status.rb
|
401
401
|
- lib/restspec/rspec/matchers/include_where.rb
|
402
402
|
- lib/restspec/rspec/shared_examples.rb
|
403
|
+
- lib/restspec/runners/installer.rb
|
403
404
|
- lib/restspec/schema/attribute.rb
|
404
405
|
- lib/restspec/schema/attribute_example.rb
|
405
406
|
- lib/restspec/schema/checker.rb
|