page_right 0.4.1 → 0.5

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: d92b143be40fcef537ffad9aae5227c7f7c2100d
4
- data.tar.gz: c46c20b7af06644391ac87ecac082e355225effb
3
+ metadata.gz: 98c311ccc03833a13ca63769cc1ffbe45e04f74f
4
+ data.tar.gz: e8eaf82d0379b75d82c5176c391d2db04b418e31
5
5
  SHA512:
6
- metadata.gz: 5d5bdc257ef4dab26d30a0cd80875c6dbf0e0883fc49e5754b1cc6cb67ce71a49379d444ecce0b5f55d683b13cc938ca9353173e6c516abf4a6337765f538601
7
- data.tar.gz: 5a5c5d217049762ce7ced4406074461777b2862145b2e76cf0249a41e2b74c89c2e16ce10e28e089443c04ea0fb311c4956d584d436556ef4aec75c472636f83
6
+ metadata.gz: 36ae33e70699608da447c8e674913b5a13704f5d879de3e6564d22731e5bff8ba5224cccce8f7142edc1272b682fb05a541fa90198d323f86927649fbd5cbcc3
7
+ data.tar.gz: ccf8e7526da997661809232b93111404380ba08100dd65fad7ecd7be86468d1c876e62f42cf7fd894130d936f36399c1e815bfe195b0bc2a01fec39b0dab8c9b
data/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ 0.5
2
+ --------------------
3
+
4
+ - Made the component libraies individually loadable via the test_help.rb file.
5
+
6
+ 0.4.1
7
+ --------------------
8
+
9
+ - Minor fix to README.md page.
10
+
11
+ 0.4
12
+ --------------------
13
+
14
+ - Migrated original code from the old page-right gem to this new page_right gem and separated out the methods into sub files.
File without changes
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## PageRight Gem - Checks the content of your rendered web pages. `Currently under development !!`
2
2
 
3
- Version 0.4.1 20th November 2014
3
+ Version 0.5 201st November 2014
4
4
 
5
5
  A very simple gem that contains a few helper/wrapper methods utilising Capybara to aid testing the contents of a rendered web page when writing integration tests.
6
6
 
@@ -16,10 +16,12 @@ Include it in your Gemfile.
16
16
  gem 'page_right'
17
17
  ```
18
18
 
19
- Then require it in your `test_helper.rb` file.
19
+ Then require one or more of the components your want to use in your `test_helper.rb` file. Currently the gem performs checks on text, css and images in your web pages.
20
20
 
21
21
  ```ruby
22
- require 'page_right'
22
+ require 'page_right/text_checks'
23
+ require 'page_right/css_checks'
24
+ require 'page_right/image_checks'
23
25
  ```
24
26
 
25
27
  ### Method Descriptions:
@@ -1,6 +1,6 @@
1
- module ActiveSupport
2
- class TestCase
3
- # Check that a css element is on the page, set flag to check that it isn't
1
+ module PageRight
2
+ module CssHelper
3
+ # Check that a css element is on the page, set flag to check that it isn't
4
4
  def css_in_page(css, flag=true)
5
5
  if flag
6
6
  assert page.has_css?("#{css}"), "Error: #{css} not found on page !"
@@ -19,5 +19,5 @@ module ActiveSupport
19
19
  end
20
20
  end
21
21
  end
22
- end
23
- end
22
+ end
23
+ end
@@ -1,5 +1,5 @@
1
- module ActiveSupport
2
- class TestCase
1
+ module PageRight
2
+ module ImageHelper
3
3
  # Check that 'count' number of 'image's is in a 'section' of css, set flag to check that it/they isn't/arn't
4
4
  def image_in_section(section, image, count, flag=true)
5
5
  if flag
@@ -8,5 +8,5 @@ module ActiveSupport
8
8
  assert !page.has_selector?(:css,"#{section} img[src$='/assets/#{image}']", count: count), "Error: #{count} #{image}(s) found in #{section} !"
9
9
  end
10
10
  end
11
- end
11
+ end
12
12
  end
@@ -0,0 +1,12 @@
1
+ require 'rails'
2
+ require 'page_right/css_helper'
3
+ require 'page_right/text_helper'
4
+ require 'page_right/image_helper'
5
+
6
+ class Railtie < Rails::Railtie
7
+ initializer "page_right.add_helpers" do
8
+ ActiveSupport::TestCase.send(:include, PageRight::TextHelper)
9
+ ActiveSupport::TestCase.send(:include, PageRight::ImageHelper)
10
+ ActiveSupport::TestCase.send(:include, PageRight::CssHelper)
11
+ end
12
+ end
@@ -1,6 +1,6 @@
1
- module ActiveSupport
2
- class TestCase
3
- # Check that the text 'content' is on the page, set flag to check that it isn't
1
+ module PageRight
2
+ module TextHelper
3
+ # Check that the text 'content' is on the page, set flag to check that it isn't
4
4
  def text_in_page(content, flag=true)
5
5
  if flag
6
6
  assert page.has_content?("#{content}"), "Error: #{content} not found page !"
@@ -19,5 +19,5 @@ module ActiveSupport
19
19
  end
20
20
  end
21
21
  end
22
- end
23
- end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module PageRight
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5"
3
3
  end
data/lib/page_right.rb CHANGED
@@ -1,7 +1,5 @@
1
- require "page_right/version"
2
- require "page_right/css_checker"
3
- require "page_right/image_checker"
4
- require "page_right/text_checker"
1
+ require 'page_right/version'
2
+ require 'page_right/railtie'
5
3
 
6
4
  begin
7
5
  require 'pry'
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: page_right
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Collier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-20 00:00:00.000000000 Z
11
+ date: 2014-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capybara
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.4'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -88,20 +102,15 @@ executables: []
88
102
  extensions: []
89
103
  extra_rdoc_files: []
90
104
  files:
91
- - ".gitignore"
92
- - CHANGES.md
93
- - Gemfile
94
- - LICENSE.txt
105
+ - CHANGELOG.md
106
+ - MIT-LICENSE
95
107
  - README.md
96
- - Rakefile
97
108
  - lib/page_right.rb
98
- - lib/page_right/css_checker.rb
99
- - lib/page_right/image_checker.rb
100
- - lib/page_right/text_checker.rb
109
+ - lib/page_right/css_helper.rb
110
+ - lib/page_right/image_helper.rb
111
+ - lib/page_right/railtie.rb
112
+ - lib/page_right/text_helper.rb
101
113
  - lib/page_right/version.rb
102
- - page_right.gemspec
103
- - test/test_helper.rb
104
- - test/test_setup_test.rb
105
114
  homepage: https://github.com/lardelbow/page_right
106
115
  licenses:
107
116
  - MIT
@@ -126,7 +135,5 @@ rubygems_version: 2.2.2
126
135
  signing_key:
127
136
  specification_version: 4
128
137
  summary: A simple gem that helps you with testing the contents of a rendered web page
129
- test_files:
130
- - test/test_helper.rb
131
- - test/test_setup_test.rb
138
+ test_files: []
132
139
  has_rdoc:
data/.gitignore DELETED
@@ -1,14 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- *.bundle
11
- *.so
12
- *.o
13
- *.a
14
- mkmf.log
data/CHANGES.md DELETED
@@ -1,9 +0,0 @@
1
- 0.4.1
2
- --------------------
3
-
4
- - Minor fix to README.md page
5
-
6
- 0.4
7
- --------------------
8
-
9
- - Migrated original code from the old page-right gem to this new page_right gem and separated out the methods into sub files.
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in page_right.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,13 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
-
4
- Rake::TestTask.new do |t|
5
- t.libs << 'test'
6
- t.pattern='"**/*_test.rb"'
7
- end
8
-
9
- task :default => :test
10
-
11
- task :console do
12
- exec "pry -r 'page_right' -I './lib'"
13
- end
data/page_right.gemspec DELETED
@@ -1,26 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'page_right/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "page_right"
8
- spec.version = PageRight::VERSION
9
- spec.authors = ["Dave Collier"]
10
- spec.email = ["lardelbow@gmail.com"]
11
- spec.summary = 'A simple gem that helps you with testing the contents of a rendered web page'
12
- spec.description = 'A simple gem that helps you with testing the contents of a rendered web page. Currently in development.'
13
- spec.homepage = "https://github.com/lardelbow/page_right"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_development_dependency "bundler", "~> 1.7"
22
- spec.add_development_dependency "rake", "~> 10.0"
23
- spec.add_development_dependency "minitest", "~> 5.4"
24
- spec.add_development_dependency "pry", "~> 0.10"
25
- spec.add_development_dependency "pry-doc", "~> 0.6"
26
- end
data/test/test_helper.rb DELETED
@@ -1,3 +0,0 @@
1
- require 'page_right'
2
- require 'minitest/autorun'
3
- require 'minitest/pride'
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class TestSetup < Minitest::Test
4
- def test_my_setup
5
- assert_equal 1, 1, "1=1 is a simple test"
6
- end
7
- end