seaweed 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/seaweed.rb CHANGED
@@ -5,6 +5,7 @@ require 'sprockets'
5
5
  require 'net/http'
6
6
  require 'rack'
7
7
  require 'yaml'
8
+ require 'selenium/webdriver'
8
9
  require 'seaweed/version'
9
10
 
10
11
  module Seaweed
@@ -20,7 +21,7 @@ module Seaweed
20
21
 
21
22
  def self.load_configuration
22
23
  # Set configuration defaults
23
- @configuration['port'] = 4567
24
+ @configuration['port'] = 4567
24
25
  @configuration['libs'] = ['lib']
25
26
  @configuration['specs'] = ['spec']
26
27
 
@@ -82,7 +83,7 @@ module Seaweed
82
83
 
83
84
  def self.spawn_server
84
85
  # Start server in its own thread
85
- Thread.new &start_server
86
+ server = Thread.new &method(:start_server)
86
87
 
87
88
  # Keep trying to connect to server until we succeed
88
89
  begin
@@ -94,15 +95,18 @@ module Seaweed
94
95
  end
95
96
 
96
97
  def self.run_suite
97
- require 'celerity'
98
-
99
98
  if @browser
100
- @browser.refresh
99
+ @browser.navigate.refresh
101
100
  else
102
- @browser = Celerity::Browser.new
103
- @browser.goto "#{root_url}#terminal"
101
+ @browser = Selenium::WebDriver.for :firefox, profile: Selenium::WebDriver::Firefox::Profile.new
102
+ @browser.get "#{root_url}#terminal"
104
103
  end
105
- puts @browser.text
104
+ puts @browser[css: '.results'].text
105
+ end
106
+
107
+ def self.close_browser
108
+ @browser.close
109
+ @browser = nil
106
110
  end
107
111
 
108
112
  def self.watch_for_changes
@@ -118,4 +122,4 @@ module Seaweed
118
122
  end
119
123
  end
120
124
 
121
- require File.expand_path(File.dirname(__FILE__) + '/seaweed/server')
125
+ require File.expand_path(File.dirname(__FILE__) + '/seaweed/server')
@@ -18,6 +18,7 @@ module Seaweed
18
18
  when 't', 'terminal'
19
19
  Seaweed.spawn_server
20
20
  Seaweed.run_suite
21
+ Seaweed.close_browser
21
22
  when 'a', 'auto'
22
23
  Seaweed.spawn_server
23
24
  Seaweed.run_suite
@@ -28,4 +29,4 @@ module Seaweed
28
29
  end
29
30
  end
30
31
  end
31
- end
32
+ end
@@ -30,4 +30,4 @@ module Seaweed
30
30
  render :slim, :index
31
31
  end
32
32
  end
33
- end
33
+ end
@@ -1,3 +1,3 @@
1
1
  module Seaweed
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seaweed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-07 00:00:00.000000000 Z
12
+ date: 2013-01-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: coffee-script
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &70334427025600 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
24
+ version_requirements: *70334427025600
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: json
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &70334426929380 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,15 +32,10 @@ dependencies:
37
32
  version: '0'
38
33
  type: :runtime
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
35
+ version_requirements: *70334426929380
46
36
  - !ruby/object:Gem::Dependency
47
37
  name: sprockets
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &70334426852540 !ruby/object:Gem::Requirement
49
39
  none: false
50
40
  requirements:
51
41
  - - ! '>='
@@ -53,15 +43,10 @@ dependencies:
53
43
  version: '0'
54
44
  type: :runtime
55
45
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
46
+ version_requirements: *70334426852540
62
47
  - !ruby/object:Gem::Dependency
63
48
  name: sinatra
64
- requirement: !ruby/object:Gem::Requirement
49
+ requirement: &70334426757100 !ruby/object:Gem::Requirement
65
50
  none: false
66
51
  requirements:
67
52
  - - ! '>='
@@ -69,15 +54,10 @@ dependencies:
69
54
  version: '0'
70
55
  type: :runtime
71
56
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
57
+ version_requirements: *70334426757100
78
58
  - !ruby/object:Gem::Dependency
79
59
  name: slim
80
- requirement: !ruby/object:Gem::Requirement
60
+ requirement: &70334418401540 !ruby/object:Gem::Requirement
81
61
  none: false
82
62
  requirements:
83
63
  - - ! '>='
@@ -85,15 +65,21 @@ dependencies:
85
65
  version: '0'
86
66
  type: :runtime
87
67
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
68
+ version_requirements: *70334418401540
69
+ - !ruby/object:Gem::Dependency
70
+ name: selenium-webdriver
71
+ requirement: &70334418313100 !ruby/object:Gem::Requirement
89
72
  none: false
90
73
  requirements:
91
74
  - - ! '>='
92
75
  - !ruby/object:Gem::Version
93
76
  version: '0'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: *70334418313100
94
80
  - !ruby/object:Gem::Dependency
95
81
  name: watchr
96
- requirement: !ruby/object:Gem::Requirement
82
+ requirement: &70334418227340 !ruby/object:Gem::Requirement
97
83
  none: false
98
84
  requirements:
99
85
  - - ! '>='
@@ -101,12 +87,7 @@ dependencies:
101
87
  version: '0'
102
88
  type: :runtime
103
89
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
90
+ version_requirements: *70334418227340
110
91
  description: Seaweed is Coffeescript behavioral testing framework, with a command
111
92
  line tool that can be used to run specs automatically.
112
93
  email: me@tobiascohen.com
@@ -149,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
130
  version: '0'
150
131
  requirements: []
151
132
  rubyforge_project:
152
- rubygems_version: 1.8.23
133
+ rubygems_version: 1.8.10
153
134
  signing_key:
154
135
  specification_version: 3
155
136
  summary: Coffeescript testing framework