tobacco 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ module Tobacco
2
+ module TestHelpers
3
+
4
+ def mock_page_content(content)
5
+ Tobacco::Inhaler.any_instance.stub(:read).and_return(content)
6
+ end
7
+
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Tobacco
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+ require_relative '../../lib/tobacco/test_helpers'
3
+
4
+ describe Tobacco::TestHelpers do
5
+ include Tobacco::TestHelpers
6
+
7
+ let(:content) { 'blah' }
8
+ let(:consumer) { mock('consumer', content_url: '/what') }
9
+
10
+ it 'returns supplied content' do
11
+ mock_page_content(content)
12
+
13
+ smoker = Tobacco::Smoker.new(consumer)
14
+ smoker.read
15
+
16
+ smoker.content.should == content
17
+ end
18
+
19
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tobacco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -117,6 +117,7 @@ files:
117
117
  - lib/tobacco/roller.rb
118
118
  - lib/tobacco/safety_net.rb
119
119
  - lib/tobacco/smoker.rb
120
+ - lib/tobacco/test_helpers.rb
120
121
  - lib/tobacco/version.rb
121
122
  - spec/spec_helper.rb
122
123
  - spec/support/vcr_cassettes/url_content.yml
@@ -129,6 +130,7 @@ files:
129
130
  - spec/tobacco/roller_spec.rb
130
131
  - spec/tobacco/safety_net_spec.rb
131
132
  - spec/tobacco/smoker_spec.rb
133
+ - spec/tobacco/test_helpers_spec.rb
132
134
  - spec/tobacco_spec.rb
133
135
  - tobacco.gemspec
134
136
  homepage: https://github.com/CraigWilliams/Tobacco
@@ -167,4 +169,5 @@ test_files:
167
169
  - spec/tobacco/roller_spec.rb
168
170
  - spec/tobacco/safety_net_spec.rb
169
171
  - spec/tobacco/smoker_spec.rb
172
+ - spec/tobacco/test_helpers_spec.rb
170
173
  - spec/tobacco_spec.rb