ftpspec 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bbd5a0a229210a2cf9339b806b53609060e51164
4
- data.tar.gz: cdd7137b58d9307673fdb27fa7ea20e6ee905ca5
3
+ metadata.gz: a2eceadc6caab553b4b27f4d70369cb869b3a726
4
+ data.tar.gz: 8bf6e80bdc89a9e55081a01fb585d71356da95dd
5
5
  SHA512:
6
- metadata.gz: c949188b95fc02f23c69c9a91c76456be7ed3674d88469ed366df2a3a8121d6492111d1befe47016fd528250e5e68f90f39dfab6b7b8424d7019f27a1c124dab
7
- data.tar.gz: ebacd76005ad7676dbd766044683eaaffcc16c47d75d7931c405aae2706126bb38814ad08db2606a5a9a7266a696ca512c2d6c301101e458999562b65fa4c7f1
6
+ metadata.gz: c85c055877de2c65f8dc9319052c1949c1b4012240f69e6aedca6d548e73ebac0ac96b285be1b20b2598951e3be9105a949305f34cedffbbc4ffe27ea8b696e6
7
+ data.tar.gz: 3ae3791147bc6a959e029acdd7e87faa408b7105beffcae9c203a602193249e2771da2e7e513d144a6186ca27cb7a0dfd951e03dc6af63e8c6e5824bc90ef027
data/README.md CHANGED
@@ -1,37 +1,27 @@
1
1
  [![Build Status](https://travis-ci.org/suzuki86/ftpspec.svg?branch=master)](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
- Clone to your machine.
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
- cd ftpspec
11
+ ```ruby
12
+ gem 'ftpspec'
23
13
  ```
24
14
 
25
- Create a gem from ftpspec.gemspec with `gem build`.
15
+ And then execute:
26
16
 
27
17
  ```
28
- gem build ftpspec.gemspec
18
+ $ bundle
29
19
  ```
30
20
 
31
- Install generated ftpspec-x.x.x.gem with `gem install`
21
+ Or install it yourself as:
32
22
 
33
23
  ```
34
- gem install ftpspec-x.x.x.gem
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
@@ -17,7 +17,7 @@ module Ftpspec
17
17
  end
18
18
 
19
19
  if filename == target then
20
- return Ftpspec::Utils.convert_to_octal(filemode).to_i == expected
20
+ return Ftpspec::Utils.convert_to_octal(filemode) == expected
21
21
  end
22
22
  end
23
23
  end
@@ -8,7 +8,7 @@ module Ftpspec
8
8
  require "spec_helper"
9
9
 
10
10
  describe "/httpdocs/index.html" do
11
- it { should be_mode 644 }
11
+ it { should be_mode "644" }
12
12
  end
13
13
  EOF
14
14
 
@@ -28,7 +28,7 @@ module Ftpspec
28
28
 
29
29
  end
30
30
  end
31
- octal.join("").to_i
31
+ octal.join("").to_s
32
32
  end
33
33
  end
34
34
  end
@@ -1,3 +1,3 @@
1
1
  module Ftpspec
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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
@@ -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 be raised error" do
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.1
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-16 00:00:00.000000000 Z
11
+ date: 2014-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler