ftpspec 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +25 -26
- data/lib/ftpspec/commands.rb +1 -1
- data/lib/ftpspec/setup.rb +1 -1
- data/lib/ftpspec/utils.rb +1 -1
- data/lib/ftpspec/version.rb +1 -1
- data/spec/command_spec.rb +3 -3
- data/spec/utils_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2eceadc6caab553b4b27f4d70369cb869b3a726
|
4
|
+
data.tar.gz: 8bf6e80bdc89a9e55081a01fb585d71356da95dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c85c055877de2c65f8dc9319052c1949c1b4012240f69e6aedca6d548e73ebac0ac96b285be1b20b2598951e3be9105a949305f34cedffbbc4ffe27ea8b696e6
|
7
|
+
data.tar.gz: 3ae3791147bc6a959e029acdd7e87faa408b7105beffcae9c203a602193249e2771da2e7e513d144a6186ca27cb7a0dfd951e03dc6af63e8c6e5824bc90ef027
|
data/README.md
CHANGED
@@ -1,37 +1,27 @@
|
|
1
1
|
[](https://travis-ci.org/suzuki86/ftpspec)
|
2
2
|
|
3
|
-
# Work in progress
|
4
|
-
|
5
|
-
This project is under development.
|
6
|
-
|
7
3
|
# FTPSpec
|
8
4
|
|
9
5
|
RSpec custom matchers for ftp server that enables you to test file structure like Serverspec.
|
10
6
|
|
11
7
|
## Installation
|
12
8
|
|
13
|
-
|
14
|
-
|
15
|
-
```
|
16
|
-
git clone https://github.com/suzuki86/ftpspec.git
|
17
|
-
```
|
18
|
-
|
19
|
-
Move to directory you cloned.
|
9
|
+
Add this line to your application's Gemfile:
|
20
10
|
|
21
|
-
```
|
22
|
-
|
11
|
+
```ruby
|
12
|
+
gem 'ftpspec'
|
23
13
|
```
|
24
14
|
|
25
|
-
|
15
|
+
And then execute:
|
26
16
|
|
27
17
|
```
|
28
|
-
|
18
|
+
$ bundle
|
29
19
|
```
|
30
20
|
|
31
|
-
|
21
|
+
Or install it yourself as:
|
32
22
|
|
33
23
|
```
|
34
|
-
gem install ftpspec
|
24
|
+
$ gem install ftpspec
|
35
25
|
```
|
36
26
|
|
37
27
|
## Usage
|
@@ -39,7 +29,7 @@ gem install ftpspec-x.x.x.gem
|
|
39
29
|
Execute ftpspec-init command.
|
40
30
|
|
41
31
|
```
|
42
|
-
ftpspec-init
|
32
|
+
$ ftpspec-init
|
43
33
|
```
|
44
34
|
|
45
35
|
Then, spec directory will be generated.
|
@@ -87,14 +77,23 @@ Write spec in each spec files.
|
|
87
77
|
require "spec_helper"
|
88
78
|
|
89
79
|
describe "/httpdocs/index.html" do
|
90
|
-
it { should be_mode 644 }
|
80
|
+
it { should be_mode "644" }
|
91
81
|
end
|
92
82
|
```
|
93
83
|
|
94
84
|
Execute rake command.
|
95
85
|
|
96
86
|
```
|
97
|
-
rake spec
|
87
|
+
$ rake spec
|
88
|
+
```
|
89
|
+
|
90
|
+
Results are shown.
|
91
|
+
|
92
|
+
```
|
93
|
+
.
|
94
|
+
|
95
|
+
Finished in 2 seconds (files took 0.14477 seconds to load)
|
96
|
+
1 examples, 0 failures
|
98
97
|
```
|
99
98
|
|
100
99
|
## Matchers
|
@@ -103,9 +102,9 @@ rake spec
|
|
103
102
|
|
104
103
|
Test whether file permission of subject is same as expected.
|
105
104
|
|
106
|
-
```
|
105
|
+
```ruby
|
107
106
|
describe "/httpdocs/index.html" do
|
108
|
-
it { should be_mode 644 }
|
107
|
+
it { should be_mode "644" }
|
109
108
|
end
|
110
109
|
```
|
111
110
|
|
@@ -113,7 +112,7 @@ end
|
|
113
112
|
|
114
113
|
Test whether subject is a file.
|
115
114
|
|
116
|
-
```
|
115
|
+
```ruby
|
117
116
|
describe "/httpdocs/index.html" do
|
118
117
|
it { should be_file }
|
119
118
|
end
|
@@ -123,7 +122,7 @@ end
|
|
123
122
|
|
124
123
|
Test whether subject is a directory.
|
125
124
|
|
126
|
-
```
|
125
|
+
```ruby
|
127
126
|
describe "/httpdocs/images" do
|
128
127
|
it { should be_directory }
|
129
128
|
end
|
@@ -133,7 +132,7 @@ end
|
|
133
132
|
|
134
133
|
Test whether subject is owned by expected owner.
|
135
134
|
|
136
|
-
```
|
135
|
+
```ruby
|
137
136
|
describe "/httpdocs/index.html" do
|
138
137
|
it { should be_owned_by "someone" }
|
139
138
|
end
|
@@ -143,7 +142,7 @@ end
|
|
143
142
|
|
144
143
|
Test whether subject is grouped into expected group.
|
145
144
|
|
146
|
-
```
|
145
|
+
```ruby
|
147
146
|
describe "/httpdocs/index.html" do
|
148
147
|
it { should be_grouped_into "admin" }
|
149
148
|
end
|
data/lib/ftpspec/commands.rb
CHANGED
data/lib/ftpspec/setup.rb
CHANGED
data/lib/ftpspec/utils.rb
CHANGED
data/lib/ftpspec/version.rb
CHANGED
data/spec/command_spec.rb
CHANGED
@@ -25,19 +25,19 @@ describe "Ftpspec::Commands" do
|
|
25
25
|
it "returns true" do
|
26
26
|
allow(@ftp).to receive(:pwd) { "/httpdocs" }
|
27
27
|
allow(Ftpspec).to receive(:get_ftp) { @ftp }
|
28
|
-
actual = Ftpspec::Commands.check_mode("/httpdocs/index.php", 644)
|
28
|
+
actual = Ftpspec::Commands.check_mode("/httpdocs/index.php", "644")
|
29
29
|
expect(actual).to be true
|
30
30
|
end
|
31
31
|
it "returns true" do
|
32
32
|
allow(@ftp).to receive(:pwd) { "/" }
|
33
33
|
allow(Ftpspec).to receive(:get_ftp) { @ftp }
|
34
|
-
actual = Ftpspec::Commands.check_mode("/index.php", 644)
|
34
|
+
actual = Ftpspec::Commands.check_mode("/index.php", "644")
|
35
35
|
expect(actual).to be true
|
36
36
|
end
|
37
37
|
it "returns false" do
|
38
38
|
allow(@ftp).to receive(:pwd) { "/httpdocs" }
|
39
39
|
allow(Ftpspec).to receive(:get_ftp) { @ftp }
|
40
|
-
actual = Ftpspec::Commands.check_mode("/httpdocs/index.php", 645)
|
40
|
+
actual = Ftpspec::Commands.check_mode("/httpdocs/index.php", "645")
|
41
41
|
expect(actual).to be false
|
42
42
|
end
|
43
43
|
end
|
data/spec/utils_spec.rb
CHANGED
@@ -3,26 +3,26 @@ require "spec_helper"
|
|
3
3
|
describe ".convert_to_octal" do
|
4
4
|
actual = Ftpspec::Utils.convert_to_octal "-rwxrwxrwx"
|
5
5
|
it "should be 777" do
|
6
|
-
expect(actual).to eq(777)
|
6
|
+
expect(actual).to eq("777")
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
10
|
describe ".convert_to_octal" do
|
11
11
|
actual = Ftpspec::Utils.convert_to_octal "-rw-r--r--"
|
12
12
|
it "should be 644" do
|
13
|
-
expect(actual).to eq(644)
|
13
|
+
expect(actual).to eq("644")
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
describe ".convert_to_octal" do
|
18
18
|
actual = Ftpspec::Utils.convert_to_octal "----------"
|
19
19
|
it "should be 000" do
|
20
|
-
expect(actual).to eq(000)
|
20
|
+
expect(actual).to eq("000")
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
describe ".convert_to_octal" do
|
25
|
-
it "should
|
25
|
+
it "should raise error" do
|
26
26
|
expect do
|
27
27
|
Ftpspec::Utils.convert_to_octal("---------")
|
28
28
|
end.to raise_error
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ftpspec
|
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
|
- Toshinari Suzuki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|