rspec-given 3.4.0 → 3.5.0

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: 28324282e7dae4f8e019d59cc094b90e43e2c2bb
4
- data.tar.gz: 12422b6076ce08f5c257d5da088a4753c6e6bc2f
3
+ metadata.gz: 7282eecfccc94c2752b34a009394f274b3601914
4
+ data.tar.gz: e9a59b264886caa1673d56bb7eae421985068752
5
5
  SHA512:
6
- metadata.gz: 931a00a40a178c7a35b6231aee226139225b6f82d4198a81ded2f0e52086d355fa5cf78f1acb18f427bcc7eced5d5a57dfa03dac5107177cf438366658c022ea
7
- data.tar.gz: d0021d7b45dab9bf98381f992acfb6bafe6237e71d3dc8237c1e0071a08d0b438d0874321cefb2e3a73d365a864129f08fde414efc8a86649d562fa146a4e876
6
+ metadata.gz: 785dbf1100fb8627abacc8a8b47a6ca1d7a3703690b65cc19ca791dc91fc0dd5c753f0473865207e48327ceba8e3ae078cab37a79ad1a3f8e94af11b4ecbf539
7
+ data.tar.gz: 0d15d014fb881cc59b5c1dfce38f0bb6938f3451071d37e613ed4c8533e8f672c048b50d42dd207dce5421d18f0e6d1f72106fd8e1280942316e8d83db341ff3
data/Gemfile.lock CHANGED
@@ -19,6 +19,7 @@ GEM
19
19
  sorcerer (1.0.2)
20
20
 
21
21
  PLATFORMS
22
+ java
22
23
  ruby
23
24
 
24
25
  DEPENDENCIES
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  | :----: |
5
5
  | [![Master Build Status](https://secure.travis-ci.org/jimweirich/rspec-given.png?branch=master)](https://travis-ci.org/jimweirich/rspec-given) |
6
6
 
7
- Covering rspec-given, minitest-given, and given-core, version 3.4.0.
7
+ Covering rspec-given, minitest-given, and given-core, version 3.5.0.
8
8
 
9
9
  rspec-given and minitest-given are extensions to your favorite testing
10
10
  framework to allow Given/When/Then notation when writing specs.
@@ -758,11 +758,15 @@ _expect_.
758
758
 
759
759
  ### Platform Support
760
760
 
761
- Natural assertions use the Ripper library to parse the failing
762
- condition and find all the sub-expression values upon a failure.
761
+ Given uses the Ripper library to parse the source lines and failing
762
+ conditions to find all the sub-expression values upon a failure.
763
763
  Currently Ripper is not supported on Rubinius and versions of JRuby
764
- prior to JRuby-1.7.5. Natural assertions are disabled in that case.
765
- However, all other features of Given are supported.
764
+ prior to JRuby-1.7.5.
765
+
766
+ If you want to use a version of Ruby that does not support Ripper,
767
+ then natural assertions will disabled. In addition, you should also
768
+ disable source caching in the configuration (see the configuration
769
+ section below).
766
770
 
767
771
  ### Non-Spec Assertions
768
772
 
@@ -787,7 +791,7 @@ end
787
791
 
788
792
  To use the non-testing assertions, you need to require the
789
793
  'given/assertions' file and then include the
790
- <code>Given::Assertions</code> module into what ever class is using
794
+ code>Given::Assertions</code> module into what ever class is using
791
795
  the
792
796
  <code>Precondition</code>/<code>Postcondition</code>/<code>Assert</code>
793
797
  methods. The code block for these assertions should always be a
@@ -0,0 +1,7 @@
1
+ require 'rspec/given'
2
+
3
+ describe "arrays split over multiple lines" do
4
+ When(:result) { 'anything' }
5
+ Then { result == ['a',
6
+ 'a'] }
7
+ end
@@ -40,4 +40,11 @@ describe "Failing Messages" do
40
40
  Given(:failing_test) { "to_bool_returns_false.rb" }
41
41
  Then { ios.out =~ /Failure\/Error: Then \{ ToBool.new \}/ }
42
42
  end
43
+
44
+ context "with an oddly formatted then" do
45
+ Given(:failing_test) { "oddly_formatted_then.rb" }
46
+ Then { ios.out =~ /Failure\/Error: Then \{ result == \['a',$/ }
47
+ And { ios.out =~ /expected: "anything"/ }
48
+ And { ios.out =~ /to equal: \["a", "a"\]/ }
49
+ end
43
50
  end
@@ -76,6 +76,16 @@ module Given
76
76
  Then { expect(result).to eq(" Then do\n x\n end\n") }
77
77
  end
78
78
 
79
+ context "when the Then is oddly formatted" do
80
+ Given(:input) {
81
+ "describe 'foobar' do\n" +
82
+ " Then { result == ['a',\n" +
83
+ " 'a'] }\n" +
84
+ "end\n"
85
+ }
86
+ Then { expect(result).to eq(" Then { result == ['a',\n 'a'] }\n") }
87
+ end
88
+
79
89
  describe "converting to a string" do
80
90
  Given(:input) { "" }
81
91
  Then { expect(extractor.to_s).to match(/line *extractor/i) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-given
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-31 00:00:00.000000000 Z
11
+ date: 2014-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: given_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.4.0
19
+ version: 3.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.4.0
26
+ version: 3.5.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -60,6 +60,7 @@ files:
60
60
  - examples/integration/and_spec.rb
61
61
  - examples/integration/failing/eval_subexpression_spec.rb
62
62
  - examples/integration/failing/module_nesting_spec.rb
63
+ - examples/integration/failing/oddly_formatted_then.rb
63
64
  - examples/integration/failing/to_bool_returns_false.rb
64
65
  - examples/integration/failing/undefined_method_spec.rb
65
66
  - examples/integration/failing_messages_spec.rb