Sha256: fb4140c3e7b03fcad7cc926a9a74764bccd609089dcd73910b6fb883187235bb

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'
require 'imdb/cli'

describe Imdb::CLI, "execute" do
  
  describe "yield search results" do
    before(:each) do
      @stdout_io = StringIO.new
      Imdb::CLI.execute(@stdout_io, ["Star Trek"])
      @stdout_io.rewind
      @stdout = @stdout_io.read
    end
  
    it "report data" do
      @stdout.should =~ /0060028/
      @stdout.should =~ /Star Trek/
      @stdout.should =~ /1966/
    end
  end

  describe "yield one movie an ID" do
    before(:each) do
      @stdout_io = StringIO.new
      Imdb::CLI.execute(@stdout_io, ["0117731"])
      @stdout_io.rewind
      @stdout = @stdout_io.read
    end
  
    it "report data" do
      @stdout.should =~ /Star Trek\: First Contact \(1996\)/
      @stdout.should =~ /Jonathan Frakes/
    end
  end
  
  describe "yield one movie with an URL" do
    before(:each) do
      @stdout_io = StringIO.new
      Imdb::CLI.execute(@stdout_io, ["http://www.imdb.com/title/tt0117731/"])
      @stdout_io.rewind
      @stdout = @stdout_io.read
    end
  
    it "report data" do
      @stdout.should =~ /Star Trek\: First Contact \(1996\)/
      @stdout.should =~ /Jonathan Frakes/
    end
    
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
imdb-0.6.5 spec/imdb/cli_spec.rb
imdb-0.6.4 spec/imdb/cli_spec.rb
imdb-0.6.3 spec/imdb/cli_spec.rb
imdb-0.6.2 spec/imdb/cli_spec.rb
imdb-0.6.1 spec/imdb/cli_spec.rb
imdb-0.6.0 spec/imdb/cli_spec.rb