cheapredwine 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -1,22 +0,0 @@
1
- require 'cheapredwine/image/params'
2
-
3
- describe CheapRedWine::Image::Params do
4
- it "takes a bunch of options" do
5
- font = double
6
- features = ['kern', 'aalt', 'onum', 'liga']
7
-
8
- params = CheapRedWine::Image::Params.new(
9
- font: font,
10
- color: 'black',
11
- features: features,
12
- text: 'Lorem ipsum',
13
- size: 26
14
- )
15
-
16
- params.font.should eq font
17
- params.color.should eq 'black'
18
- params.features.should eq features
19
- params.text.should eq 'Lorem ipsum'
20
- params.size.should eq 26
21
- end
22
- end
@@ -1,20 +0,0 @@
1
- require 'cheapredwine/image/writer'
2
- require 'cheapredwine/image/params'
3
-
4
- describe CheapRedWine::Image::Writer do
5
- let(:font) { double("font", path: "spec/fixtures/lato-regular.ttf") }
6
- let(:image) { CheapRedWine::Image::Params.new(font: font, text: "Lorem ipsum") }
7
-
8
- it "builds a command from a Params object" do
9
- writer = CheapRedWine::Image::Writer.new(image)
10
- writer.args[0].should eq "--font-file=spec/fixtures/lato-regular.ttf"
11
- end
12
-
13
- it "generates a image of given text" do
14
- file = File.new('spec/fixtures/test.png')
15
-
16
- writer = CheapRedWine::Image::Writer.new(image)
17
- tempfile = writer.exec
18
- FileUtils.compare_file(tempfile, file)
19
- end
20
- end