friendly_ghost 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48a7dbe825d5d0ea425094abc2fc94d361e5f367
4
- data.tar.gz: fbda8fd3e4ee7d94399a191609c1f5586b0e882d
3
+ metadata.gz: ec91afa6f760873582af43d9aac2046073621011
4
+ data.tar.gz: 2010865484d2485252e67be3a75623f4e4cfd2ac
5
5
  SHA512:
6
- metadata.gz: 02ebf5e533fb7a9a27841f698b86ca0b041236c6a946241494c372130aa333014996dc417086f72eadbc83975c719910d079e0ff48b7f5ec4fb3b22490f9e563
7
- data.tar.gz: 3417a94e98bdb7bf53143e6251e800363b5aa8b2892631139d9889acacaf2458d1f140cec2bcf2d026ccd8f4707a2a16aa8b6968a29921073fc28222ac56a123
6
+ metadata.gz: ea25b32deb12786f1dabbb6865f22a74d3f5ed4b2ee69b001421b2decd28c3ee277743d0a46578c6d2c3e7dba8e5bfdca8d74ec4c5acef8d8503390d661ccab0
7
+ data.tar.gz: 9569d1170bc6520f28d7a26e3b0a1dbf6fd5daa14621faa5c0609c858bfa7bc7a41fba5562b3ab15de353b11b6cf53f04abe819bf66967f36613e8448ec14642
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
5
+ - jruby-19mode
6
+ - rbx-19mode
7
+ before_script:
8
+ - "export PHANTOMJS_EXECUTABLE='phantomjs --local-to-remote-url-access=yes --ignore-ssl-errors=yes'"
9
+ - git clone git://github.com/n1k0/casperjs.git
10
+ - "export PATH=./casperjs/bin:$PATH"
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # (casper, the) friendly_ghost
1
+ # (casper, the) friendly_ghost [![Build Status](https://travis-ci.org/ezkl/friendly_ghost.png)](https://travis-ci.org/ezkl/friendly_ghost)
2
2
  ## Overview
3
3
  A simplistic, opinionated Ruby runner for [CasperJS](http://casperjs.org)
4
4
  projects. Designed to hand JSON from the last line of STDOUT back to the user.
@@ -19,6 +19,7 @@ Gem::Specification.new do |gem|
19
19
 
20
20
  gem.add_dependency 'posix-spawn', '~> 0.3.6'
21
21
  gem.add_dependency 'multi_json', '~> 1.7.2'
22
+ gem.add_dependency 'casperjs', '~> 1.0.0'
22
23
 
23
24
  gem.add_development_dependency 'rake'
24
25
  gem.add_development_dependency 'rspec'
@@ -21,8 +21,13 @@ module FriendlyGhost
21
21
  @result
22
22
  end
23
23
 
24
+ def raw_output
25
+ @process.out
26
+ end
27
+
24
28
  def parse_result
25
- output = @process.out.split(/\n/).last.strip
29
+ json_line = @process.out.split(/\n/).select { |line| line =~ /\{/ }
30
+ output = json_line.first.strip
26
31
  MultiJson.load(output)
27
32
  end
28
33
  end
@@ -1,3 +1,3 @@
1
1
  module FriendlyGhost
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -14,7 +14,7 @@ module FriendlyGhost
14
14
  let(:response) { runner.command arguments }
15
15
 
16
16
  context 'success' do
17
- let(:arguments) { 'test spec/support/json.js' }
17
+ let(:arguments) { 'test spec/support/json_1.js' }
18
18
 
19
19
  it 'should return the status' do
20
20
  response['status'].should be_true
@@ -26,7 +26,7 @@ module FriendlyGhost
26
26
  end
27
27
 
28
28
  context 'failure' do
29
- let(:arguments) { 'test spec/support/fail.js' }
29
+ let(:arguments) { 'test spec/support/json_2.js' }
30
30
 
31
31
  it 'should return the status' do
32
32
  response['status'].should be_false
@@ -37,5 +37,12 @@ module FriendlyGhost
37
37
  end
38
38
  end
39
39
  end
40
+
41
+ describe '#raw_output' do
42
+ it 'should return the raw log output' do
43
+ runner.command('test spec/support/json_1.js')
44
+ runner.raw_output.split(/\n/).size.should >= 2
45
+ end
46
+ end
40
47
  end
41
48
  end
@@ -7,9 +7,5 @@ casper.wait(500, function() {
7
7
  });
8
8
 
9
9
  casper.run(function() {
10
- if(this.test.getFailures().length >= 1) {
11
- this.exit(-1);
12
- } else {
13
- this.exit(0);
14
- }
10
+ this.test.done();
15
11
  });
@@ -6,9 +6,5 @@ casper.wait(500, function() {
6
6
  });
7
7
 
8
8
  casper.run(function() {
9
- if(this.test.getFailures().length >= 1) {
10
- this.exit(-1);
11
- } else {
12
- this.exit(0);
13
- }
9
+ this.test.done();
14
10
  });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: friendly_ghost
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
  - Ezekiel Templin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-18 00:00:00.000000000 Z
11
+ date: 2013-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: posix-spawn
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.7.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: casperjs
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 1.0.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 1.0.0
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -75,6 +89,7 @@ extra_rdoc_files: []
75
89
  files:
76
90
  - .gitignore
77
91
  - .rspec
92
+ - .travis.yml
78
93
  - Gemfile
79
94
  - Guardfile
80
95
  - README.md
@@ -85,8 +100,8 @@ files:
85
100
  - lib/friendly_ghost/version.rb
86
101
  - spec/friendly_ghost/runner_spec.rb
87
102
  - spec/spec_helper.rb
88
- - spec/support/fail.js
89
- - spec/support/json.js
103
+ - spec/support/json_1.js
104
+ - spec/support/json_2.js
90
105
  homepage: https://github.com/ezkl/friendly_ghost
91
106
  licenses:
92
107
  - MIT
@@ -114,6 +129,6 @@ summary: Ruby runner for CasperJS
114
129
  test_files:
115
130
  - spec/friendly_ghost/runner_spec.rb
116
131
  - spec/spec_helper.rb
117
- - spec/support/fail.js
118
- - spec/support/json.js
132
+ - spec/support/json_1.js
133
+ - spec/support/json_2.js
119
134
  has_rdoc: