Sha256: 764c1239e7246f02effce8773e46700bd820e30b910409a5492a9fbad1bb5458

Contents?: true

Size: 1.87 KB

Versions: 5

Compression:

Stored size: 1.87 KB

Contents

require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')

core_2000 = Smartfm::List.find(705)

Smartfm::List::ATTRIBUTES.each do |attr|
  describe Smartfm::List, "##{attr}" do
    it "should be accessible" do
      core_2000.should respond_to(attr)
    end
  end
end

Smartfm::List::READONLY_ATTRIBUTES.each do |attr|
  describe Smartfm::List, "##{attr}" do
    it "should not be nil" do
      core_2000.should_not be_nil
    end
  end
end

[:iknow, :dictation, :brainspeed].each do |application|
  Smartfm::List::Application::ATTRIBUTES.each do |attr|
    describe Smartfm::List::Application, "##{attr}" do
      it "should be accessible for #{application}" do
        core_2000.send(application).should respond_to(attr)
      end
      it "should not be nil for #{application}" do
        core_2000.send(application).send(attr).should_not be_nil unless attr == :progress
      end
    end
  end
  describe Smartfm::List::Application, "#available?" do
    it "should be true for #{application}" do
      core_2000.send(application).available?.should be_true
    end
  end
end

describe Smartfm::List::Application, "#progress" do
  it "should be nil for brainspeed" do
    core_2000.brainspeed.progress.should be_nil
  end
end

describe Smartfm::List, '#items' do
  it "should return a Array of Smartfm::Item" do
    core_2000.items.should be_a(Array)
    core_2000.items.each do |item|
      item.should be_a(Smartfm::Item)
    end
  end
end

describe Smartfm::List, '#sentences' do
  it "should return a Array of Smartfm::Sentence" do
    core_2000.sentences.should be_a(Array)
    core_2000.sentences.each do |sentence|
      sentence.should be_a(Smartfm::Sentence)
    end
  end
end

describe Smartfm::List, '#likes' do
  it "should return a Array of Smartfm::Like" do
    core_2000.likes.should be_a(Array)
    core_2000.likes.each do |like|
      like.should be_a(Smartfm::Like)
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
nov-smartfm-1.0.0 spec/smartfm/model/list_spec.rb
nov-smartfm-1.0.2 spec/smartfm/models/list_spec.rb
smartfm-1.0.2 spec/smartfm/models/list_spec.rb
smartfm-1.0.1 spec/smartfm/models/list_spec.rb
smartfm-1.0.0 spec/smartfm/models/list_spec.rb