swamp 1.3.0 → 1.3.1

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: d75a81ad2f5980818dc56e8a9142268169597d0a
4
- data.tar.gz: 762d89066107e05871ef922878edc4127cbb7d26
3
+ metadata.gz: 847a3ad24ced1c7638928fb5ede6945aa0e45b5c
4
+ data.tar.gz: b1bfa972a7c19a3022e75e18c006ed37f69f6f57
5
5
  SHA512:
6
- metadata.gz: 8487ad90dd5a1a27c3afa5678fbb39884a7517832cb062cc26c06aa4378fa475eedade961a6efa4b4ed48d9abfe5aa710f200fde997675453c783bcf081dae41
7
- data.tar.gz: dad587976af09e6837e65dbd0ae6951733839b94f5120ce03416ebe39350bdea58679b3d856de119c4a0615e0c1a8e17a0c0cea1702e14a66804909577b1b7fa
6
+ metadata.gz: 8a048407fe8e70e48cbb7d546b7192f602f7b3a45b410c971357c26b099b24ed425ef9064d7df292a844cde56a2f045432b914aa9d65b163cf3533c6ab2f7099
7
+ data.tar.gz: 2544657716ca5091ae0ffbee4cad07357eac354d4d01dfe1ada3f273d7b6acad60289faeafb7975fe0ebf3f8ff3de63b9ceeab9018f32233d8caa4a253369a7d
@@ -6,7 +6,7 @@ When /^(?:I start it|that swamp is already running)$/ do
6
6
  end
7
7
 
8
8
  Then /^I should see "(.*?)"$/ do |outcome|
9
- fake_output.messages.should include(outcome)
9
+ expect(fake_output.messages).to include(outcome)
10
10
  end
11
11
 
12
12
  Given /^I enter the url for this page: "(\w+\.html)"$/ do |page|
@@ -25,15 +25,15 @@ When /^I attempt to scan this page: "(\w+\.html)"$/ do |page|
25
25
  end
26
26
 
27
27
  Then /^(?:swamp|it) should output the following code snippets?$/ do |string|
28
- fake_output.messages.should include(string)
28
+ expect(fake_output.messages).to include(string)
29
29
  end
30
30
 
31
31
  Then /^swamp should not output any snippet$/ do
32
- fake_output.messages.size.should <= 3
32
+ expect(fake_output.messages.size).to be <= 3
33
33
  fake_output.messages.each do |m|
34
- m.should_not include("def")
35
- m.should_not include("source.")
36
- m.should_not include("page.")
34
+ expect(m).not_to include("def")
35
+ expect(m).not_to include("source.")
36
+ expect(m).not_to include("page.")
37
37
  end
38
38
  end
39
39
 
@@ -42,7 +42,7 @@ Given /^that swamp already have scanned a page$/ do
42
42
  path = File.join(File.dirname(__FILE__), '../support/page_examples/', "button.html")
43
43
  @url = "file://#{path}"
44
44
  swamp.scan(@url)
45
- fake_output.messages.should include("def sign_up\n page.click_button(\"Sign Up\")\nend")
45
+ expect(fake_output.messages).to include("def sign_up\n page.click_button(\"Sign Up\")\nend")
46
46
  end
47
47
 
48
48
  When /^I attempt to hit enter at the terminal$/ do
@@ -50,19 +50,19 @@ When /^I attempt to hit enter at the terminal$/ do
50
50
  end
51
51
 
52
52
  Then /^swamp should scan the current page$/ do
53
- fake_output.messages.size.should <= 5
54
- fake_output.messages[3].should == "Scanning, please wait..."
55
- fake_output.messages[4].should == "def sign_up\n page.click_button(\"Sign Up\")\nend"
53
+ expect(fake_output.messages.size).to be <= 5
54
+ expect(fake_output.messages[3]).to eq "Scanning, please wait..."
55
+ expect(fake_output.messages[4]).to eq "def sign_up\n page.click_button(\"Sign Up\")\nend"
56
56
  end
57
57
 
58
58
  Then /^swamp should highlight this (element|link): "(.+)"$/ do |mode, selector|
59
59
  page = Capybara.current_session
60
- page.should have_css "#{selector}[style]"
60
+ expect(page).to have_css "#{selector}[style]"
61
61
  if mode == "element"
62
- page.find(selector)[:style].should include("border-width: 3px")
63
- page.find(selector)[:style].should include("border-color: rgb(255, 0, 0)")
62
+ expect(page.find(selector)[:style]).to include("border-width: 3px")
63
+ expect(page.find(selector)[:style]).to include("border-color: rgb(255, 0, 0)")
64
64
  else
65
- page.find(selector)[:style].should include("background-color: rgb(255, 0, 0)")
65
+ expect(page.find(selector)[:style]).to include("background-color: rgb(255, 0, 0)")
66
66
  end
67
67
  end
68
68
 
data/lib/swamp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Swamp
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
data/lib/swamp/wrapper.rb CHANGED
@@ -18,9 +18,14 @@ module Swamp
18
18
  def scan
19
19
  found_snippets = []
20
20
  @meta_collection.each do | element_collection |
21
- found_snippets += element_collection.get.map { | element | @setup.builder.build_snippet(element) }
21
+ found_snippets += element_collection.get.map { | element | build_snippet(element) }
22
22
  end
23
23
  found_snippets
24
24
  end
25
+
26
+ private
27
+ def build_snippet(element)
28
+ @setup.builder.build_snippet(element)
29
+ end
25
30
  end
26
31
  end
data/swamp.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "capybara", '~> 2.4'
22
- spec.add_dependency "selenium-webdriver", '~> 2.43'
22
+ spec.add_dependency "selenium-webdriver", '~> 2.46'
23
23
 
24
24
  spec.add_development_dependency "bundler", '~> 1.6'
25
25
  spec.add_development_dependency "rake", '~> 10.3'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swamp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juraci de Lima Vieira Neto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-20 00:00:00.000000000 Z
11
+ date: 2015-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.43'
33
+ version: '2.46'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.43'
40
+ version: '2.46'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement