ryana-plug_test 0.1.1 → 0.1.2

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.
@@ -35,12 +35,9 @@ Whenever you want to test a helper just call:
35
35
 
36
36
  pt_helper { [CODE YOU WANT TO TEST] }
37
37
 
38
- The only caveat, is that due to a few isms of Rails, you have to structure your blocks so that an argument is passed into the block,
39
- and all your helper methods use that as a receiver.
40
-
41
38
  pt_helper will return the output of the call and setup your @response so you can do:
42
39
 
43
- res = pt_helper { |a| a.link_to 'my link text', :action => 'test' }
40
+ res = pt_helper { link_to 'my link text', :action => 'test' }
44
41
  assert_response :success
45
42
  assert_select 'a', 'my link text'
46
43
  assert(/my link text/.match(res))
@@ -9,7 +9,7 @@ module PlugTest
9
9
  if @plug_test_text
10
10
  @plug_test_answer = render_to_string(:inline => "<%=" + @plug_test_text + "%>")
11
11
  elsif @plug_test_block
12
- @plug_test_answer = @plug_test_block.call(@template)
12
+ @plug_test_answer = @template.instance_eval(&@plug_test_block)
13
13
  else
14
14
  raise 'You win -- Did you call this method directly?'
15
15
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{plug_test}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Ryan Angilly"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ryana-plug_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Angilly