letter_bomb 0.0.4 → 0.1.0

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.
@@ -1,16 +1,15 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe LetterBomb::Preview do
4
-
5
- describe ".previews" do
6
- it "returns" do
7
- LetterBomb::Preview.previews.should include FooMailerPreview
4
+ describe ".classes" do
5
+ it "returns a list of classes within app/mailers suffixed with preview" do
6
+ expect(LetterBomb::Preview.classes).to include(FooMailerPreview)
8
7
  end
9
8
  end
10
9
 
11
- describe ".mailer_actions" do
10
+ describe ".actions" do
12
11
  it "returns an alphabetized list of public instance methods" do
13
- FooMailerPreview.mailer_actions.should == ['bad', 'good']
12
+ expect(FooMailerPreview.actions).to eq(['bad', 'good'])
14
13
  end
15
14
  end
16
15
 
@@ -21,35 +20,12 @@ describe LetterBomb::Preview do
21
20
  end.to_not change { User.count }
22
21
  end
23
22
 
24
- it "returns the result of the called method" do
25
- FooMailerPreview.preview_action(:good).should == 'result of good'
26
- end
27
- end
28
-
29
- describe ".has_factory_girl" do
30
- it "requires FactoryGirl on preview initialization" do
31
- class FactoryPreview < LetterBomb::Preview; has_factory_girl; end
23
+ it "returns a Preview::Action for the Mail object" do
24
+ action = FooMailerPreview.preview_action(:good)
32
25
 
33
- expect do
34
- FactoryPreview.new
35
- end.to change { !!defined?(FactoryGirl) }.to(true)
26
+ # TODO using #send makes writing a mock expectation tricky
27
+ expect(action.name).to eq(:good)
28
+ expect(action).to be_a(LetterBomb::Preview::Action)
36
29
  end
37
30
  end
38
-
39
- describe "#lchomp" do
40
- it "removes a given string from the start of a target string" do
41
- LetterBomb::Preview.lchomp('abcd/edfg/abcd', 'abcd').should == '/edfg/abcd'
42
- end
43
- context "when the target string does not begin with the removable string" do
44
- it "returns the target string" do
45
- LetterBomb::Preview.lchomp('edfg/abcd', 'abcd').should == 'edfg/abcd'
46
- end
47
- end
48
- context "when the target string does not contain the removable string" do
49
- it "returns the target string" do
50
- LetterBomb::Preview.lchomp('edfg', 'abcd').should == 'edfg'
51
- end
52
- end
53
- end
54
-
55
31
  end
@@ -13,4 +13,3 @@ RSpec.configure do |config|
13
13
 
14
14
  config.order = 'random'
15
15
  end
16
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letter_bomb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-16 00:00:00.000000000 Z
11
+ date: 2013-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails