gisture 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gisture/version.rb +1 -1
- data/lib/gisture.rb +2 -2
- data/spec/gisture_spec.rb +58 -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: eff3867b98cd4f91cd816b80166b3a6761e6db77
|
4
|
+
data.tar.gz: 2799910dab4a2dab134173c25fe89451c19fd798
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52a916183c9a8c6d2b828a8a12c1e28acc9d55b381b411d6c4b0241f6788a75bc7a55fdaf7a3db1246f11c269412fd773505c5cb2923aead113fb76ef3b3a5fe
|
7
|
+
data.tar.gz: 901ef651cb25079f268b7696359d9df52ed2786b23264696b234377023c2ac1eceb7259f66257cb24cfc8d650b9bbb14c331fee2d38b87fad40f6470bb065a47
|
data/lib/gisture/version.rb
CHANGED
data/lib/gisture.rb
CHANGED
@@ -37,11 +37,11 @@ module Gisture
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.gist(gist, strategy: nil, filename: nil, version: nil)
|
40
|
-
new(gist, strategy, filename, version)
|
40
|
+
new(gist, strategy: strategy, filename: filename, version: version)
|
41
41
|
end
|
42
42
|
|
43
43
|
def self.run(gist, strategy: nil, filename: nil, version: nil, &block)
|
44
|
-
new(gist, strategy, filename, version).run!(&block)
|
44
|
+
new(gist, strategy: strategy, filename: filename, version: version).run!(&block)
|
45
45
|
end
|
46
46
|
|
47
47
|
def self.repo(repo)
|
data/spec/gisture_spec.rb
CHANGED
@@ -1,8 +1,62 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe Gisture do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
describe '.new' do
|
5
|
+
it 'returns a new Gisture::Gist' do
|
6
|
+
expect(Gisture.new(TEST_GIST_ID)).to be_a(Gisture::Gist)
|
7
|
+
end
|
8
|
+
|
9
|
+
context 'with arguments' do
|
10
|
+
it 'passes the arguments to the gist' do
|
11
|
+
gist = Gisture.new(TEST_GIST_ID, filename: TEST_GIST_FILENAME, strategy: :require, version: TEST_GIST_VERSION)
|
12
|
+
expect(gist.filename).to eql(TEST_GIST_FILENAME)
|
13
|
+
expect(gist.strategy).to eql(:require)
|
14
|
+
expect(gist.version).to eql(TEST_GIST_VERSION)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '.gist' do
|
20
|
+
it 'returns a new Gisture::Gist' do
|
21
|
+
expect(Gisture.gist(TEST_GIST_ID)).to be_a(Gisture::Gist)
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'with arguments' do
|
25
|
+
it 'passes the arguments to the gist' do
|
26
|
+
gist = Gisture.gist(TEST_GIST_ID, filename: TEST_GIST_FILENAME, strategy: :require, version: TEST_GIST_VERSION)
|
27
|
+
expect(gist.filename).to eql(TEST_GIST_FILENAME)
|
28
|
+
expect(gist.strategy).to eql(:require)
|
29
|
+
expect(gist.version).to eql(TEST_GIST_VERSION)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# TODO should test that the file receives a call to run!
|
35
|
+
describe '.run' do
|
36
|
+
it 'creates and runs a new Gisture::Gist' do
|
37
|
+
expect { Gisture.run(TEST_GIST_ID) }.to_not raise_exception
|
38
|
+
end
|
39
|
+
|
40
|
+
context 'with arguments' do
|
41
|
+
it 'passes the arguments to the gist' do
|
42
|
+
# TODO stub Github::Client::Gists.version
|
43
|
+
#expect { Gisture.run(TEST_GIST_ID, filename: TEST_GIST_FILENAME, strategy: :require, version: TEST_GIST_VERSION) }.to_not raise_exception
|
44
|
+
expect { Gisture.run(TEST_GIST_ID, filename: TEST_GIST_FILENAME, strategy: :require) }.to_not raise_exception
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
describe '.repo' do
|
50
|
+
it 'returns a new Gisture::Repo' do
|
51
|
+
# TODO stub out Github::Client::Repos
|
52
|
+
#expect(Gisture.repo('markrebec/gisture')).to be_a(Gisture::Repo)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe '.file' do
|
57
|
+
it 'returns a new Gisture::File' do
|
58
|
+
# TODO stub out Github::Client::Repos::Contents
|
59
|
+
#expect(Gisture.file('https://github.com/markrebec/gisture/blob/master/lib/gisture.rb')).to be_a(Gisture::File)
|
60
|
+
end
|
61
|
+
end
|
8
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gisture
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rebec
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: canfig
|