watir-rspec 2.0.2 → 2.0.3

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: 3fe29b37229f959db5b8b6b466d9e4fb7d88b5c8
4
- data.tar.gz: 6a9a31c3b8df8a13e6754f5f0613f1f001911af5
3
+ metadata.gz: 17aea3a055c86e44d544fc3afca4290e951b60fe
4
+ data.tar.gz: 78034a62b03accd0bed96ed385f8f36757c3536e
5
5
  SHA512:
6
- metadata.gz: 70f3fe05b402535b0a8d320af933537d785b2b625ebff64150d71f6afb2c0b09dd22d5e0fbf788a95b79032dd9291cab6e63dd2a39b8ddba2765fc43e26b9687
7
- data.tar.gz: 55cd37ecf601751480795f34671511679a54d6bef57aa90f5f2f0bcaef54e928e4afb283906380992c90f7394278a5e7e0d518df6023e93ca5188b1b992b2942
6
+ metadata.gz: 5dfa485af98c2e3302ba14a1ebff06fd52d92513dbffb82ac8f092e44cfaaa5f19161e10ee2c760ab67d54b562ceebbbe514c4a7e0cfb6ac307f4fb7ac288730
7
+ data.tar.gz: 47d2bedea996603336f9693ad7fbde25f17c8867314c8414238851570edfedb3edc2c39da373843367ae38501313af7353c409bace69ad47be27270bfd476a7b
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 2.0.3 - 2015/05/09
2
+
3
+ * Improve readme/documentation.
4
+
1
5
  ### 2.0.2 - 2015/03/21
2
6
 
3
7
  * Fix delegating methods to browser with blocks having parameters. Closes #12.
data/README.md CHANGED
@@ -40,16 +40,16 @@ describe "Google" do
40
40
  before { goto "http://google.com" }
41
41
 
42
42
  it "has search box" do
43
- text_field(:name => "q").should be_present
43
+ expect(text_field(name: "q")).to be_present
44
44
  end
45
45
 
46
46
  it "allows to search" do
47
- text_field(:name => "q").set "watir"
48
- button(:id => "gbqfb").click
49
- results = div(:id => "ires")
50
- results.should be_present.within(2)
51
- results.lis(:class => "g").map(&:text).should be_any { |text| text =~ /watir/ }
52
- results.should be_present.during(1)
47
+ text_field(name: "q").set "watir"
48
+ button(id: "gbqfb").click
49
+ results = div(id: "ires")
50
+ expect(results).to be_present.within(2)
51
+ expect(results.lis(class: "g").map(&:text)).to be_any { |text| text =~ /watir/ }
52
+ expect(results).to be_present.during(1)
53
53
  end
54
54
  end
55
55
  ````
@@ -62,7 +62,7 @@ to the files created during tests.
62
62
  ```ruby
63
63
  uploaded_file_path = Watir::RSpec.file_path("uploaded.txt")
64
64
  File.open(uploaded_file_path, "w") {|file| file.write "Generated File Input"}
65
- file_field(:name => "upload-file").set uploaded_file_path
65
+ file_field(name: "upload-file").set uploaded_file_path
66
66
  ```
67
67
 
68
68
  ### Rails
@@ -8,7 +8,7 @@ module Watir
8
8
  def execute
9
9
  @options = {}
10
10
  parser = OptionParser.new do |opts|
11
- opts.banner = "Install watir-rspec configuration into spec_helper file.
11
+ opts.banner = "Install watir-rspec configuration into spec_helper.rb file.
12
12
 
13
13
  Usage: watir-rspec [options] install"
14
14
 
@@ -66,11 +66,11 @@ RSpec.configure do |config|
66
66
  # Include RSpec::Helper into each of your example group for making it possible to
67
67
  # write in your examples instead of:
68
68
  # @browser.goto "localhost"
69
- # @browser.text_field(:name => "first_name").set "Bob"
69
+ # @browser.text_field(name: "first_name").set "Bob"
70
70
  #
71
71
  # like this:
72
72
  # goto "localhost"
73
- # text_field(:name => "first_name").set "Bob"
73
+ # text_field(name: "first_name").set "Bob"
74
74
  #
75
75
  # This needs that you've used @browser as an instance variable name in
76
76
  # before :all block.
@@ -78,12 +78,12 @@ RSpec.configure do |config|
78
78
 
79
79
  # Include RSpec::Matchers into each of your example group for making it possible to
80
80
  # use #within with some of RSpec matchers for easier asynchronous testing:
81
- # @browser.text_field(:name => "first_name").should exist.within(2)
82
- # @browser.text_field(:name => "first_name").should be_present.within(2)
83
- # @browser.text_field(:name => "first_name").should be_visible.within(2)
81
+ # expect(@browser.text_field(name: "first_name")).to exist.within(2)
82
+ # expect(@browser.text_field(name: "first_name")).to be_present.within(2)
83
+ # expect(@browser.text_field(name: "first_name")).to be_visible.within(2)
84
84
  #
85
85
  # You can also use #during to test if something stays the same during the specified period:
86
- # @browser.text_field(:name => "first_name").should exist.during(2)
86
+ # expect(@browser.text_field(name: "first_name")).to exist.during(2)
87
87
  config.include Watir::RSpec::Matchers#{rails_filter}
88
88
  end
89
89
  ]
@@ -113,7 +113,7 @@ Make sure you run the watir-rspec command within your projects' directory.]
113
113
  end
114
114
 
115
115
  def rails_filter
116
- ", :type => :request" if using_rails?
116
+ ", type: :request" if using_rails?
117
117
  end
118
118
 
119
119
  def using_rails?
@@ -13,9 +13,9 @@ module Watir
13
13
 
14
14
  # Will dispatch all missing methods to the {#browser} instance.
15
15
  # @example Makes it possible to use Watir::Browser methods without specifying the browser instance in the specs like this:
16
- # it "should do something" do
16
+ # it "text field is present" do
17
17
  # # notice that we're calling Watir::Browser#text_field here directly
18
- # text_field(:id => "foo").should be_present
18
+ # expect(text_field(id: "foo")).to be_present
19
19
  # end
20
20
  def method_missing(name, *args)
21
21
  if browser.respond_to?(name)
@@ -3,10 +3,10 @@ module Watir
3
3
  # All matchers defined in here have the ability to be used for asynchronous
4
4
  # testing.
5
5
  #
6
- # There is #within matcher which means that the expected result should happen
6
+ # #within matcher means that the expected result should happen
7
7
  # within the specified time period.
8
8
  #
9
- # There also exists less used #during matcher which means that the expected
9
+ # Also less used #during matcher which means that the expected
10
10
  # result should be true for the whole specified time period.
11
11
  #
12
12
  # @example Wait for 2 seconds until element is present (element exists and is visible)
@@ -18,7 +18,7 @@ module Watir
18
18
  # @example Wait for 2 seconds until element exists
19
19
  # expect(text_field).to exist.within(2)
20
20
  #
21
- # @example Make sure that container is visible for the whole time during 2 seconds
21
+ # @example Verify that container is visible for the whole time during 2 seconds
22
22
  # button.click
23
23
  # expect(text_field).to be_visible.during(2)
24
24
  module Matchers
@@ -1,5 +1,5 @@
1
1
  module Watir
2
2
  class RSpec
3
- VERSION = "2.0.2"
3
+ VERSION = "2.0.3"
4
4
  end
5
5
  end
@@ -28,7 +28,7 @@ describe Watir::RSpec::Matchers::BaseMatcher do
28
28
  end
29
29
 
30
30
  context "#within" do
31
- around { |example| should_take_at_least(0.1) { example.run }}
31
+ around { |example| expect_to_take_at_least(0.1) { example.run }}
32
32
 
33
33
  it "#matches?" do
34
34
  object = double("element")
@@ -102,7 +102,7 @@ describe Watir::RSpec::Matchers::BaseMatcher do
102
102
  end
103
103
 
104
104
  context "#during" do
105
- around { |example| should_take_at_least(0.1) { example.run }}
105
+ around { |example| expect_to_take_at_least(0.1) { example.run }}
106
106
 
107
107
  it "#matches?" do
108
108
  object = double("element", foo?: true)
@@ -173,7 +173,7 @@ describe Watir::RSpec::Matchers::BaseMatcher do
173
173
  end
174
174
  end
175
175
 
176
- def should_take_at_least(seconds)
176
+ def expect_to_take_at_least(seconds)
177
177
  t = Time.now
178
178
  yield
179
179
  expect(Time.now - t).to be >= seconds
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarmo Pertman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-21 00:00:00.000000000 Z
11
+ date: 2015-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec